View source: R/1a-propr-backend.R
logratio_with_alpha | R Documentation |
This function applies a log-ratio transformation to a given data matrix
using an alpha parameter. The log-ratio transformation is based on a
selected subset of columns specified by the 'use' argument.
The transformation formula is: log(x/ref) = log(x) - log(ref) =
[x^alpha-1]/alpha - [ref^alpha-1]/alpha
, where x
represents the
data matrix and ref
is the reference value calculated as the mean
of the selected subset of columns.
logratio_with_alpha(ct, use, alpha)
ct |
A data matrix for which the log-ratio transformation will be performed. It is assumed that the matrix contains numerical values only. |
use |
An integer vector specifying the subset of columns to be used for the log-ratio transformation. |
alpha |
The alpha parameter used in the transformation. |
A matrix containing the log-ratio transformed data.
# Sample input data
data <- matrix(c(1, 2, 3, 4, 5, 6), nrow = 2, byrow = TRUE)
# Applying log-ratio transformation with alpha = 2 to rows using columns 2 and 3
result <- logratio_with_alpha(data, use = c(2, 3), alpha = 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.