Skip to contents

Applies a moderated logarithmic transformation to a numeric vector. Adjustments are made based on a specified quantile and a floor value. All transformed values are guaranteed to be in the domain suitable for log10.

Usage

moderate_log_transform(x, q, f)

Arguments

x

A numeric vector to be transformed.

q

The quantile adjustment value.

f

The minimum value of the adjustment floor, used to avoid negative or zero logarithm domain.

Value

A numeric vector with the logarithmically transformed values.

Examples

moderate_log_transform(c(1, 2, 3, 4, 5), 0.5, 0.1)
#> [1] 0.0000000 0.2041200 0.4149733 0.5563025 0.6627578