Description Usage Arguments Details Note Author(s) See Also Examples
An S4 class to represent a count matrix.
1 2 
data 
an optional data vector (including a list or

nrow 
the desired number of rows. 
ncol 
the desired number of columns. 
byrow 
logical. If 
dimnames 
A 
Numeric values are coerced to integer
as by
as.integer
(and hence truncated towards zero).
This class extends the base
matrix.
N. Frerebeau
matrix
Other abundance matrix: FrequencyMatrixclass
1 2 3 4 5 6 7 8 9 10 11 12 13  # Create a count data matrix
A1 < CountMatrix(data = sample(0:10, 100, TRUE),
nrow = 10, ncol = 10, byrow = TRUE)
# Coerce counts to frequencies
B < as(A1, "FrequencyMatrix")
# Row sums are internally stored before coercing to a frequency matrix
totals(B) # Get row sums
# This allows to restore the source data
A2 < as(B, "CountMatrix")
all(A1 == A2)

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.