powered by
Closes compositions to sum to 1.
closure(x, ...)# S4 method for numeric closure(x, total = 1, na.rm = TRUE)# S4 method for matrix closure(x, total = 1, na.rm = TRUE)
# S4 method for numeric closure(x, total = 1, na.rm = TRUE)
# S4 method for matrix closure(x, total = 1, na.rm = TRUE)
A numeric vector or matrix (same as x).
numeric
x
A numeric vector or matrix.
Currently not used.
A numeric vector specifying the total amount to which the compositions should be closed (defaults to 1).
A logical scalar: should missing values be removed?
logical
N. Frerebeau
Other operations in the simplex: arithmetic, perturbation(), powering(), scalar()
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)
Run the code above in your browser using DataLab