R CheatSheet

How to sum by column:

Use “sum” to sum by column. Example: sum(datafame$column, na.rm=true)

Subsetting

small <- subset(original, select=c(weight, Time), subset=(Diet==4 && Time > 20))

References