Skip to content

Instantly share code, notes, and snippets.

View amandamasonsingh's full-sized avatar

Amanda Mason-Singh amandamasonsingh

View GitHub Profile
@squito
squito / mylib.R
Last active June 13, 2019 19:09
searchable source dirs for R (aka, a "classpath" for R)
## this should get loaded by your ~/.Rprofile
## either just stick all these definitions right in ~/.Rprofile, or
## have ~/.Rprofile source this file, etc.
source.dirs <- c(
## add any "base" locations here. this is like a "classpath" in java
## my default is c("~/myRUtils/src","~/companyRUtils/src","~/publicRUtils"),
## but you can use whatever you like
paste(Sys.getenv("HOME"),"myRUtils","src", sep="/"),
paste(Sys.getenv("HOME"),"companyRUtils","src", sep="/"),
@cdesante
cdesante / basicmap.r
Created December 10, 2012 17:55
basic map
doInstall <- TRUE
toInstall <- c("maps", "ggplot2")
if(doInstall){install.packages(toInstall, repos = "http://cran.us.r-project.org")}
lapply(toInstall, library, character.only = TRUE)
library(ggplot2)
library(maps)
Prison <- read.csv("http://www.oberlin.edu/faculty/cdesante/assets/downloads/prison.csv")
head(Prison)