log_if: Apply logarithmic transformation

log_ifR Documentation

Apply logarithmic transformation

Description

Log-transforms the input x if mult_fit is TRUE; otherwise, returns the original input x unchanged.

Usage

log_if(x, mult_fit)

Arguments

x

A numeric vector to be transformed.

mult_fit

Logical; set to TRUE to apply logarithmic transformation, and FALSE to keep the original input.

Value

A numeric vector after applying the logarithmic transformation (if mult_fit = TRUE); otherwise, it returns the original input.

See Also

new_transformation

Examples

x <- runif(1e4, 1, 100)
all.equal(log_if(x, TRUE), log(x))
all.equal(log_if(x, FALSE), x)


iNZightVIT/iNZightTS documentation built on Feb. 3, 2024, 11:50 p.m.