I have 4 columns, and about 300K plus rows with 0s and 1s.

I'm trying to count how many rows satisfy a certain criteria... for
instance, how many rows are there that have the first column == 1 as
well as the second column == 1.

I've tried using rowSums and colSums but it keeps giving me this type of error:

Error in rowSums(X[1] == 1 & X[2] == 1) :
  'x' must be an array of at least two dimensions

Thanks in advance!

______________________________________________
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