transform_data: Apply a Transformation to Vector

View source: R/transf.R

transform_dataR Documentation

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")
)

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)

Value

A numeric vector with the applied transformation.

Examples

## Not run: 
transform_data(c(-1, 0, 1), transfm = "tanh")
transform_data(c(-1, 0, 1), transfm = "invlogit")
transform_data(c(-1, 0, 1), transfm = "none")

## End(Not run)

daniel1noble/orchaRd documentation built on April 17, 2025, 3:59 a.m.