for example, i want to sum all the row entries if column 1 takes the value "boy". anyone knows ? -- View this message in context: old.nabble.com/any-equivalent-SUM-IF-statement-in-R-tp26467889p26467889.html Sent from the R help mailing list archive at Nabble.com.
Presumably you want all the columns _except_ column 1, right? Perhaps (no code, no test) : sum( dta[ dta[,1]=="boy , -1 ] ) -- David. On Nov 22, 2009, at 3:44 PM, ychu066 wrote:> > for example, i want to sum all the row entries if column 1 takes the > value > "boy". anyone knows ? > -- > View this message in context: old.nabble.com/any-equivalent-SUM-IF-statement-in-R-tp26467889p26467889.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at r-project.org mailing list > stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.David Winsemius, MD Heritage Laboratories West Hartford, CT