I have a sample dataframe \"data\" as follows:
X Y Month Year income 2281205 228120 3 2011 1000 2281212 228121 9 2010 1100 22812
I think the package dplyr is faster than plyr::ddply and more elegant.
dplyr
plyr::ddply
testData <- read.table(file = "clipboard",header = TRUE) require(dplyr) testData %>% group_by(Y) %>% summarise(total = sum(income),freq = n()) %>% filter(freq > 3)