transformers {simBKMRdata}R Documentation

Data Transformation Functions

Description

This script provides transformation functions for data scaling and normalization.

Usage

trans_ratio(x, method = c("sd", "mad"))

trans_root(x, fracRoot = 0.5)

trans_log(x, base = 10, shift = 1)

Arguments

x

A numeric vector or column of a dataframe to be transformed.

method

Character string specifying the method: "sd" (standard deviation) or "mad" (median absolute deviation).

fracRoot

The fractional power to which each element in x should be raised. Defaults to 0.5 (square root).

base

The base of the logarithm. Defaults to 10.

shift

A numeric value added to x before applying the logarithm to avoid log(0). Defaults to 1.

Value

A numeric vector where values are divided by the chosen method's statistic.

A numeric vector of transformed values.

A numeric vector of transformed values.

Examples

trans_ratio(c(1, 2, 3, 4, 5), method = "sd")
trans_root(c(1, 4, 9, 16), fracRoot = 0.5)
trans_log(c(1, 10, 100, 1000), base = 10, shift = 1)

[Package simBKMRdata version 0.2.1 Index]