coda.base

Compositional Bases for Log-Ratio Transformations

This R package provides tools for working with compositional data using log-ratio methodology, following the foundational work of Aitchison and further developments by Egozcue and collaborators.

The package is focused on the construction and use of orthonormal and non-orthonormal bases for the representation of compositions in real coordinates, enabling advanced statistical modeling and interpretation.

Key Functions

Example

library(coda.base)

# Define a simple 3-part composition
x <- c('a' = 0.2, 'b' = 0.3, 'c' = 0.5)

# Create an ILR basis and express x in ILR coordinates
B <- ilr_basis(x)
h <- coordinates(x, B)  
h

# Recover the original composition
composition(h, B)

Installation

You can install the development version from GitHub:

# Install development version from GitHub
remotes::install_github("mcomas/coda.base")

and the cran version with:

# Install release version from CRAN
install.packages("coda.base")