Stable lifecycle

  • root: nth root

  • root_sqrt: square root

  • root_cubic: cubic root

root(x, root = NULL, modulus = FALSE)

root_sq(x, ...)

root_cubic(x, ...)

Arguments

x

[univariate vector]

Univariate vector, numeric or ts object with only one dimension.

root

[numeric(1): NA]

The nth root.

modulus

[logical(1): FALSE]

Transformation will work for data with both positive and negative root.

...

Further arguments passed to root.

Examples

root(4, 2)
#> [1] 2
root(-4, 2)
#> [1] NaN
root(-4, 2, TRUE)
#> [1] -2