as.data.frame | R Documentation |
Coerce to a Data Frame
## S4 method for signature 'CompositionMatrix'
as.data.frame(x, ..., group_var = ".group", group_after = 0)
## S4 method for signature 'LogRatio'
as.data.frame(x, ..., group_var = ".group", group_after = 0)
## S4 method for signature 'OutlierIndex'
as.data.frame(x, row.names = rownames(x), optional = FALSE, ...)
x |
An R object (typically, a |
... |
Further parameters to be passed to
|
group_var |
A |
group_after |
An |
row.names |
A |
optional |
A |
A data.frame
.
N. Frerebeau
Other mutators:
labels()
,
totals()
,
weights()
## 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 <- as.data.frame(B)
head(X)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.