## ----vectors------------------------------------------------------------- x <- c(1, 3, 6) ## ----data-types---------------------------------------------------------- y <- c("red", "yellow", "green") z <- c(TRUE, FALSE) ## ----str----------------------------------------------------------------- str(iris) ## ----summary------------------------------------------------------------- summary(iris) ## ----single column------------------------------------------------------- head(iris$Sepal.Length, 4) fivenum(iris$Sepal.Length) quantile(iris$Sepal.Length, 0.25) ## ----table--------------------------------------------------------------- table(iris$Species) ## ----2way-table---------------------------------------------------------- petalCat <- cut(iris$Petal.Width, breaks = c(0, 1, 2, 3)) table(iris$Species, petalCat) ## ----boxplot, out.width = "5cm", out.height = "5cm", fig.show = "hold"---- boxplot(iris$Petal.Width) with(iris, boxplot(Petal.Width ~ Species)) ## ----hist, out.width = "5cm", out.height = "5cm", fig.show = "hold"------ hist(iris$Petal.Width) plot(density(iris$Petal.Width)) ## ----scatter------------------------------------------------------------- mycol <- c("blue", "orange", "green") with(iris, plot(Petal.Width ~ Petal.Length, col = mycol[Species])) ## ----lineplot, fig.show = "hold"----------------------------------------- with(pressure, plot(pressure ~ temperature, type = "l")) with(pressure, plot(pressure ~ temperature, type = "b")) ## ----searchpath---------------------------------------------------------- search() ## ----try-truehist-------------------------------------------------------- truehist(iris$Species) ## ----truehist------------------------------------------------------------ library(MASS) truehist(iris$Species) ## ----bioconductor-------------------------------------------------------- source("https://bioconductor.org/biocLite.R") biocLite("limma", "edgeR") ## ----github-------------------------------------------------------------- ## !! requires development tools to be installed, see ## http://www2.warwick.ac.uk/fac/sci/wdsi/vacationschool2016/for-participants/prep library(devtools) # need to install from CRAN install_github("hadley/vctrs")