R/forecastplot.R
log_if.Rd
Log-transforms the input x if mult_fit is TRUE; otherwise, returns the original input x unchanged.
x
mult_fit
log_if(x, mult_fit)
A numeric vector to be transformed.
Logical; set to TRUE to apply logarithmic transformation, and FALSE to keep the original input.
A numeric vector after applying the logarithmic transformation (if mult_fit = TRUE); otherwise, it returns the original input.
numeric
mult_fit = TRUE
new_transformation
x <- runif(1e4, 1, 100) all.equal(log_if(x, TRUE), log(x)) #> [1] TRUE all.equal(log_if(x, FALSE), x) #> [1] TRUE