Marginal Compositions
Usage
margin(x, ...)
# S4 method for class 'CompositionMatrix'
margin(x, parts = c(1, 2), name = "*")Arguments
- x
A
CompositionMatrixobject.- ...
Currently not used.
- parts
An
integeror acharactervector specifying the columns to be selected.- name
A
characterstring giving the name of the amalgamation column.
Value
A CompositionMatrix object.
See also
Other statistics:
aggregate(),
condense(),
covariance(),
dist,
mahalanobis(),
mean(),
pip(),
quantile(),
scale(),
variance(),
variance_total(),
variation()
Examples
## Data from Aitchison 1986
data("hongite")
## Coerce to compositional data
coda <- as_composition(hongite)
## Marginal compositions
mar <- margin(coda, parts = c("B", "D"))
head(mar)
#> <CompositionMatrix: 6 x 3>
#> B D *
#> H1 0.6328342 0.1277646 0.2394011
#> H2 0.4837434 0.1869933 0.3292633
#> H3 0.2163720 0.2258829 0.5577451
#> H4 0.4936486 0.2094895 0.2968618
#> H5 0.6888621 0.1384919 0.1726460
#> H6 0.5360281 0.2557386 0.2082334
