R - TopN Analysis

About

Package

data.frame

  • One column
head(sort(du20150915Qas$size,decreasing=TRUE), n = 10)
  • All column
head(data.frame[order(data.frame$name, decreasing= T),], n = 10)

plyr

R - Dplyr (Data Frame Operations)

library(plyr)
head(arrange(data.frame,desc(name)), n = 10)

data.table

the first two rows for each month with a R - Data Table

ans <- flights[, head(.SD, 2), by = month]

Powered by ComboStrap