R/pow_trans.R

Defines functions power_trans

Documented in power_trans

#' A signed power transform
#'
#' @param power power exponent of the direct transform
#'
#' @export
power_trans <- function(power = 1)
{
  force(power)
  trans <- function(x) sign(x)*(abs(x)**power)
  inv <- function(x) sign(x)*(abs(x)**(1/power))
  trans_new(paste0("power-", format(power)), trans, inv,
            domain = c(-Inf, Inf))
}

Try the ggwordcloud package in your browser

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

ggwordcloud documentation built on Oct. 26, 2023, 5:07 p.m.