as.data.frame {nexus} | R Documentation |
Coerce to a Data Frame
Description
Coerce to a Data Frame
Usage
## 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, ...)
Arguments
x |
An R object (typically, a |
... |
Further parameters to be passed to
|
group_var |
A |
group_after |
An |
row.names |
A |
optional |
A |
Value
A data.frame
.
Author(s)
N. Frerebeau
See Also
Other mutators:
labels()
,
totals()
,
weights()
Examples
## 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)
[Package nexus version 0.6.0 Index]