colTabulate(bin, nbins = max(bin), weights = NULL)
1
and
nbins
, inclusive.
Missing values are not accepted.
max(bin)
.
bin
.
nbins
rows and the same number of columns as
bin
.
The
[i,j]
element of the value is
the number of
i
s that occured in
bin[,j]
.
The result is equivalent to
apply(bin, 2, tabulate, nbins=max(bin))
,
except that column names are ignored.
Or, if
weights
is supplied, the weights
for observations with
bin[,j] == i
.
colTabulate(cbind(rep(1:4, 4:1), rep(1:2, each=5)))