R/functions_misc.R

Defines functions yj_vector boxcox_vector

# This file contains miscellaneous helper functions

# Box-Cox transformation function
boxcox_vector <- function(vector_input) {
  vector_input <- vector_input + min(vector_input) + 1
  lambda <- powerTransform(vector_input)$lambda
  vector_input <- (vector_input + 1) ^ lambda
  return(vector_input)
}

# Yeo-Johnson transformation

yj_vector <- function(vector_input) {
  vector_input <- vector_input ^ coef(powerTransform(vector_input,
                                                     family = "yjPower"))
}
mixtrak/wellington.aquifer.ecol documentation built on Nov. 30, 2017, 4:25 a.m.