Learn R Programming

orchaRd (version 2.2.1)

transform_data: Apply a Transformation to Vector

Description

This function applies a specified transformation to a numeric vector.

Usage

transform_data(
  x,
  n = NULL,
  transfm = c("none", "tanh", "invlogit", "percentr", "percent", "inv_ft")
)

Value

A numeric vector with the applied transformation.

Arguments

x

A numeric vector.

n

Used with "inv_ft". A numeric value representing the sample size for proportion.

transfm

A character string specifying the transformation to apply. Options include: - "none": No transformation (default) - "tanh": Hyperbolic tangent transformation - "invlogit": Inverse logit transformation - "percentr": Percentage relative change transformation - "percent": Percentage transformation - "inv_ft": Inverse Freeman-Tukey (double arcsine) transformation for proportions (use with caution)