ron-r
3/5/2014 - 1:46 PM

From http://stackoverflow.com/questions/22198951/calculate-mean-with-a-filter-on-a-columns-values Applying functions on a filtered column

mean(testd$salary[testd$salary>=25000])

another way is using data table that should be much faster:

testd<-data.table(testd)
testd[salary>25000,mean(salary)]