[R] "non-numeric argument to binary operator"

the_big_kowalski bkowalski at csumb.edu
Wed Jun 15 07:43:31 CEST 2011


"Most likely reason is that the number of unique values in the rows of
habs is not the same."

Yes, I think that is the problem, thank you.
How would I write the code to include 0s in the matrix, 
ie, I want to have a record of when 1, 2, or 3 does not get sampled, 
to come up with a frequency of each value for each nn (which in this case is
5)

I tried 'factor' but what ends up happening is that the matrix gets reduced
to zero 
after a couple of iterations.

habs=t(apply(habs, 1, function(x) table(factor(x, levels = 1:3))))

--
View this message in context: http://r.789695.n4.nabble.com/non-numeric-argument-to-binary-operator-tp3598160p3598563.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list