R/cube.R

## Cube and cubic root of a numeric vector
## Copyright (c) 2015, Philippe Grosjean (phgrosjean@sciviews.org)

## Cube of numbers
cube <- function (x)
{
    if (!is.numeric(x))
        stop("'x' must be numeric")
    x^3
}

## Cubic root, like square root
cbrt <- function (x)
{
    if (!is.numeric(x))
        stop("'x' must be numeric")
    x^(1/3)    
}
phgrosjean/R-code documentation built on May 25, 2019, 2:55 a.m.