Transforms x if cond is TRUE by \(\log(a+b*x)\) if p==0 and \((a+b*x)^p)\).
Otherwise the transformation can be either applied to each element of x, or to all elements of x.
Usage
transformif(x, cond, a = -abs(min(x)), b = 1, p = 1)
Value
A transformed vector
Arguments
x
vector: values
cond
logical: condition if transformation should be applied