neglog: Negative-log transformation

Description Usage Arguments Details Value

View source: R/clean_functions.R

Description

An analogue to the log transformation for negative values.

Usage

1
neglog(x, base = exp(1), offset = 0.5)

Arguments

x

a numeric or complex vector

base

a positive or complex number: the base with respect to which logarithms are computed. Defaults to e=exp(1)

offset

a number specifying an offset to avoid neglog(x) returning -Inf. Defaults to 0.5

Details

neglog(x) is calculated such that neglog(x) = sign(x) * \log(|x + offset|). The offset ensures that no -Inf value is returned. The default offset is 0.5.

Value

A vector of the same length as x containing the transformed values.


mdtrinh/vietnamdata documentation built on May 3, 2019, 11:49 p.m.