Learn R Programming

rray (version 0.0.0.9000)

rray_square: Power functions

Description

  • rray_square() - computes the elementwise square of x (i.e. x * x).

  • rray_cube() - computes the elementwise cube of x (i.e. x * x * x).

  • rray_sqrt() - computes the elementwise square root of x.

  • rray_cbrt() - computes the elementwise cube root of x.

  • rray_hypot() - computes the elementwise square root of the sum of squares of x and y.

Usage

rray_square(x)

rray_cube(x)

rray_sqrt(x)

rray_cbrt(x)

rray_hypot(x, y)

Arguments

x, y

A vector, matrix, array or rray.

Examples

Run this code
# NOT RUN {
x <- matrix(c(2, 4, 6))

rray_square(x)
rray_sqrt(x)

rray_cube(x)
rray_cbrt(x)

# With broadcasting
rray_hypot(x, t(x))

# }

Run the code above in your browser using DataLab