# NOT RUN {
# example InsectSprays from R datasets
InsectSprays$Type <- ifelse(InsectSprays$spray %in% c('A','B', 'F'), 1, 2)
ind <- group_sort(InsectSprays$count,
group=list(Spray=InsectSprays$spray, Type=InsectSprays$Type))
InsectSprays[ind,]
InsectSprays
# }
Run the code above in your browser using DataLab