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 ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.