R
dput(mtcars) How to make a great R reproducible example? - Stack Overflow [http://stackoverflow.com/]
An R Graphical User Interface (GUI) for Everyone Deducer: A GUI for R - Deducer Manual [http://www.deducer.org/]
plot(l28.cnt) likert [http://jason.bryer.org/]
```{r basicconsole}
x ← 1:10
y ← round(rnorm(10, x, 1), 2)
df ← data.frame(x, y)
df
``` Getting Started with R Markdown, knitr, and Rstudio 0.96 [http://jeromyanglim.blogspot.ca/]
plot_throughtime(terms = “phylogeny”, limit = 200, gvis = FALSE) rOpenSci - rplos tutorial [http://ropensci.org/]
Selecting columns by name is easy:
df[,c('sequence','start','end')] Select operations on R data frames | (R news & tutorials) [http://www.r-bloggers.com/]
* It's crantastic! [http://crantastic.org/]
base time series architecture in ts()
more advanced ways to deal with time/date classes
Lubridate
xts
check out
CRAN Time Series Task View: General Overview
library(zoo) for general ordered obs
library(dynlm) for dynamic regressions R Introduction for UCL PhDs (81)
# Creating data for correlation analysis
bschoolcorr←bschools[c(-2,-3,-4,-5,-16,-17,-18,-19)] #dropping non-numeric columns
corrmatrix←cor(bschoolcorr) #store corr matrix
corrplot(corrmatrix,method=“shade”,shade.col=NA,tl.col=“black”,tl.srt=45) # Plot corrmatrix—- Where would I be without Winston Chang's R Graphics cookbook bschools/Bschoolrankinganalysis.R at master · patilv/bschools
df ← data.frame(x = c(rnorm(100, 0, 3), rnorm(100, 0, 10)),
g = gl(2, 100))
ggplot(df, aes(x, colour = g)) + stat_ecdf() r - Easier way to plot the cumulative frequency distribution in ggplot? - Stack Overflow
catcolwise and numcolwise provide version that only operate on discrete and numeric variables respectively. R: Column-wise function.
ddply(baseball, .(year), colwise(nmissing, .(sb, cs, so)))
ddply(baseball, .(year), colwise(nmissing, c(“sb”, “cs”, “so”)))
ddply(baseball, .(year), colwise(nmissing, ~ sb + cs + so))
# Alternatively, you can specify a boolean function that determines
# whether or not a column should be included
ddply(baseball, .(year), colwise(nmissing, is.character))
ddply(baseball, .(year), colwise(nmissing, is.numeric))
ddply(baseball, .(year), colwise(nmissing, is.discrete))
# These last two cases are particularly common, so some shortcuts are
# provided:
ddply(baseball, .(year), numcolwise(nmissing))
ddply(baseball, .(year), catcolwise(nmissing))
# You can supply additional arguments to either colwise, or the function
# it generates:
numcolwise(mean)(baseball, na.rm = TRUE)
numcolwise(mean, na.rm = TRUE)(baseball) R: Column-wise function.