closure | R Documentation |
Closes compositions to sum to 1.
closure(x, ...)
## S4 method for signature 'numeric'
closure(x, total = 1, na.rm = TRUE)
## S4 method for signature 'matrix'
closure(x, total = 1, na.rm = TRUE)
x |
A |
... |
Currently not used. |
total |
A numeric vector specifying the total amount to which the compositions should be closed (defaults to 1). |
na.rm |
A |
A numeric
vector or matrix (same as x
).
N. Frerebeau
Other operations in the simplex:
arithmetic
,
perturbation()
,
powering()
,
scalar()
x <- as_composition(c(1, 2, 3))
y <- as_composition(c(1, 2, 1))
## Perturbation
perturbation(x, y)
x + y
## Powering
powering(y, 2)
y * 2
## Scalar product
scalar(x, y)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.