R/invCLR.r

Defines functions invCLR

Documented in invCLR

invCLR <- function(CLRmatrix, part.names=colnames(CLRmatrix)) {
# Inverts a I x J matrix of centred logratios (CLRs)
# back to their original compositional part values
# CLRmatrix = matrix of CLRs, ratios in columns
# Returns an I x J matrix of parts
  clr <- exp(CLRmatrix) / apply(exp(CLRmatrix), 1, sum)
  colnames(clr) <- part.names
  clr
}

Try the easyCODA package in your browser

Any scripts or data that you put into this service are public.

easyCODA documentation built on Jan. 15, 2022, 3 a.m.