
Last chance! 50% off unlimited learning
Sale ends in
rowTabulates(x, rows=NULL, cols=NULL, values=NULL, ...)
colTabulates(x, rows=NULL, cols=NULL, values=NULL, ...)
matrix
where
N (K) is the number of row (column) vector
s tabulated and
J is the number of values counted.x <- matrix(1:5, nrow=10, ncol=5)
print(x)
print(rowTabulates(x))
print(colTabulates(x))
# Count only certain values
print(rowTabulates(x, values=1:3))
y <- as.raw(x)
dim(y) <- dim(x)
print(y)
print(rowTabulates(y))
print(colTabulates(y))
Run the code above in your browser using DataLab