Note to self: Basic R operations

2012-10-18 22:55
After searching for that all too often and for too long (in particular the "add a column as index" bit):


  • To read a file: d
  • Useful for getting an overview of the data:summary(d); head(d); tail(d)
  • For sorting some data frame: s
  • For adding a column to a data frame: s$idx
  • For plotting a column: ggplot(s, aes(idx, engagement)) + geom_point() +scale_x_log10()