% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/main.r
\name{calc_clr}
\alias{calc_clr}
\title{Perform the Centered Log-Ratio (CLR) transformation.}
\usage{
calc_clr(df)
}
\arguments{
\item{df}{A data frame or matrix of strictly positive relative frequencies or
counts (samples/observations as columns, components as rows).}
}
\value{
A data frame of the same dimensions containing the CLR-transformed
values.
}
\description{
The CLR transformation is a common technique used for compositional data
analysis, mapping the data from the simplex to Euclidean space. It is defined
as the log of the ratio between each component and the geometric mean of all
components in that sample. \strong{Note:} This function assumes the input data is
strictly positive (i.e., does not contain zeros). Use an imputation or
pseudocount method prior to this function if zeros are present.
}
\examples{
freq_imp <- data.frame(A = c(10.1, 89.9), B = c(50.1, 49.9))
calc_clr(freq_imp)
}
