This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
doInstall <- TRUE # Change to FALSE if you don't want packages installed. | |
toInstall <- c("ReadImages", "reshape", "ggplot2") | |
if(doInstall){install.packages(toInstall, repos = "http://cran.r-project.org")} | |
lapply(toInstall, library, character.only = TRUE) | |
# Image URL: | |
allImageURLs <- c("http://media.charlesleifer.com/blog/photos/thumbnails/akira_940x700.jpg", | |
"http://upload.wikimedia.org/wikipedia/commons/thumb/e/ec/Mona_Lisa%2C_by_Leonardo_da_Vinci%2C_from_C2RMF_retouched.jpg/402px-Mona_Lisa%2C_by_Leonardo_da_Vinci%2C_from_C2RMF_retouched.jpg", | |
"http://upload.wikimedia.org/wikipedia/commons/thumb/e/e9/Official_portrait_of_Barack_Obama.jpg/441px-Official_portrait_of_Barack_Obama.jpg", | |
"http://cache.boston.com/universal/site_graphics/blogs/bigpicture/obama_11_05/obama22_16604051.jpg", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Singleton pattern | |
Singleton <- setRefClass("Singleton", | |
fields=list( | |
Class="ANY", | |
instance="ANY" | |
), | |
methods=list( | |
initialize=function(...) { | |
"Override this by defining Class" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#read the libraries | |
library(plyr) | |
library(ggplot2) | |
library(xtable) | |
#set the working direcotry to where you saved the output.csv file from the previous post | |
setwd("/.../") | |
#read the data | |
data <- read.csv("output.csv") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.libPaths() #By default, R will install packages to the first element | |
#This script will install some very common R packages. | |
repos = 'http://cran.r-project.org' #Main CRAN | |
repos.win = 'http://www.stats.ox.ac.uk/pub/RWin' #Site provides some prebuilt binaries for Windows | |
repos.rforge = 'http://r-forge.r-project.org' | |
libraries = c('Deducer', 'devtools', 'doBy', 'foreign', 'gdata', 'ggplot2', 'gmaps', | |
'Hmisc', 'JGR', 'maps', 'mapdata', 'mapproj', 'maptools', 'proto', 'psych', 'R2wd', | |
'Rcmdr', 'RCurl', 'reshape', 'RODBC', 'roxygen2', 'seqinr', 'sm', 'sp', |