Transform compositional data to isometric log-ratio (ILR) coordinates.
Arguments
- x
A numeric matrix or data frame of compositional data.
- delta
Optional replacement value passed to
replace_zeros().- fraction
Fraction of the smallest non-zero value used by
replace_zeros()whendelta = NULL.
Details
Columns with zero variance are removed before transformation because they do not contribute information and can cause numerical problems.
Zeros are replaced using replace_zeros() prior to transformation.
Examples
x <- data.frame(
a = c(0.5, 0.4, 0.6),
b = c(0.3, 0.4, 0.2),
c = c(0.2, 0.2, 0.2)
)
make_ilr(x)
#> ilr_1
#> 1 -0.3612083
#> 2 0.0000000
#> 3 -0.7768362
