[R] partially sum variable of a dataframe

Bert Gunter gunter.berton at gene.com
Wed Nov 7 18:57:15 CET 2007


 
Or even simpler (when cc is a data frame), instead of

sum(cc[cc[,"a"] <= 5.25 & cc[,"a"] >= 3, "b"])

##

with(cc, sum(b[a <= 5.25 & a >= 3]))



Bert Gunter
Genentech Nonclinical Statistics



More information about the R-help mailing list