Aitchison's centered log ratio tranformation for compositional data
Usage
clr(data, group = NULL)
Arguments
data
a data frame in which the data is stored
group
if not NULL then a character string specifying the name of the
grouping variable
Value
a data frame with the CLR transformation applied to data. Each row
in the data frame is standardized by dividing by the geometric mean of that
row. The logarithms of the resulting ratios are returned. If a grouping
variable is specified, then this is preserved.
Details
This function will give a warning if zeros are present because the
transformed data will have -Infs.
References
Aitchison, J. (1986). ``The Statistical Analysis of
Compositional Data'', Chapman and Hall, reprinted in 2003 with additional
material by The Blackburn Press
# NOT RUN {data(bottle.df)
## transform preserving groupingclr(bottle.df, "Number")
## transform the data but remove the## grouping in column 1clr(bottle.df[,-1])
# }