# NOT RUN {
## Create a count matrix
A1 <- CountMatrix(data = sample(0:10, 100, TRUE),
nrow = 10, ncol = 10)
## Coerce counts to frequencies
B <- as_frequency(A1)
## Row sums are internally stored before coercing to a frequency matrix
## (use totals() to get these values)
## This allows to restore the source data
A2 <- as_count(B)
all(A1 == A2)
## Coerce to presence/absence
C <- as_incidence(A1)
## Coerce to a co-occurrence matrix
D <- as_occurrence(A1)
# }
Run the code above in your browser using DataLab