as_amounts | R Documentation |
Coerce to Amounts
as_amounts(from, ...)
## S4 method for signature 'CompositionMatrix'
as_amounts(from)
from |
A |
... |
Currently not used. |
A numeric
matrix
.
N. Frerebeau
Other compositional data tools:
as_composition()
## Create a count matrix
A1 <- matrix(data = sample(1:100, 100, TRUE), nrow = 20)
## Coerce to compositions
B <- as_composition(A1)
## Row sums are internally stored before coercing to relative frequencies
totals(B)
## This allows to restore the source data
A2 <- as_amounts(B)
## Coerce to a data.frame
X <- data.frame(B)
head(X)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.