R/green.R

Defines functions green

Documented in green

green <- function(x, theta) {
  ## x contains the compositional data
  ## theta is the power parameter, usually between -1 and 1
  D <- dim(x)[2] ## number of components
  if ( D == 1 )   x <- t(x)
  if ( theta != 0 ) {
    z <- ( x^theta - 1 ) / theta
  } else {  
    z <- Rfast::Log(x)
  }
  z
}

Try the Compositional package in your browser

Any scripts or data that you put into this service are public.

Compositional documentation built on Oct. 9, 2024, 5:10 p.m.