Hi there,
I have the following code:
z - matrix(c(A, A, B, B, C, C, A, B, C), ncol = 3)
apply(z, 2, table, c(A, B, C))
which give correct results.
However, the following code:
apply(z[,1,drop=FALSE], 2, table, c(A, B, C))
which does not give what I expect. I have been thought it should give
On May 19, 2013, at 16:22 , Jinsong Zhao wrote:
Hi there,
I have the following code:
z - matrix(c(A, A, B, B, C, C, A, B, C), ncol = 3)
apply(z, 2, table, c(A, B, C))
which give correct results.
However, the following code:
apply(z[,1,drop=FALSE], 2, table, c(A, B, C))
which
...@yeah.net
To: R help r-help@r-project.org
Cc:
Sent: Sunday, May 19, 2013 10:22 AM
Subject: [R] apply and table
Hi there,
I have the following code:
z - matrix(c(A, A, B, B, C, C, A, B, C), ncol = 3)
apply(z, 2, table, c(A, B, C))
which give correct results.
However, the following code:
apply(z
3 matches
Mail list logo