On 22/11/2009 3:44 PM, ychu066 wrote:
for example, i want to sum all the row entries if column 1 takes the value
"boy". anyone knows ?

Subset then sum:

sum(M[M[,1] == "boy", ])

Duncan Murdoch

______________________________________________
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.

Reply via email to