Get the latest stable R release from
CRAN. Then install the released version of
orrery:
# Not yet on CRAN! install.packages('orrery')Or install the development version from this repository:
install.packages("remotes")
remotes::install_github("minotau-R/orrery")library(orrery)
library(dirmult)# Create a table with 20 features and 2 samples
x <- rdirichlet(2, runif(20))
# CLR transform
x.clr <- dclr(x)
# compute distance
dist.x <- dist(x.clr, method = "euclidean")
# Copy x into y
y <- rbind(x, perturb_by_relab(x[1L, ], by = 10))
y.clr <- dclr(y)
dist.y <- dist(y.clr, method = "euclidean")
dist.x
#> 1
#> 2 20.92217
dist.y
#> 1 2
#> 2 20.922171
#> 3 9.847272 22.894288