Skip to content

Instantly share code, notes, and snippets.

*.pyc
#Setup
rm(list = ls(all = TRUE)) #CLEAR WORKSPACE
#Directory
setwd("~/Overfitting")
#Load Required Packages
library('caTools')
library('caret')
library('glmnet')
@mattbaggott
mattbaggott / plyr_NOMINATE.R
Created October 27, 2012 16:18 — forked from dsparks/plyr_NOMINATE.R
Visualizing polarization in congress
# minor changes from script by dsparks
# Letting plyr do the work for us.
#
# Install and load needed packages
doInstall <- TRUE # Change to FALSE if you don't want packages installed.
toInstall <- c("foreign", "plyr", "Hmisc", "ggplot2")
toInstall <- toInstall[!toInstall%in%library()$results[,1]] #check if present
if(doInstall&length(toInstall)!=0)
{install.packages(toInstall, repos = "http://cran.r-project.org")}