BCT <- function(x,lambda=NULL,...){
if(is.null(lambda)){
#require(forecast)
lambda <- forecast::BoxCox.lambda(x,...)
}
forecast::BoxCox(x, lambda)
#if (lambda == 0) log( x )
#else ( (x) ^ lambda - 1 ) / lambda
}
BCT.rev <- function(x,lambda,...){
#require(forecast)
forecast::InvBoxCox(x, lambda, ...)
#if (lambda == 0) exp(x)
#else (x*lambda +1)^(1/lambda)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.