Learn R Programming

rray (version 0.1.0)

rray_flip: Flip an rray along a dimension

Description

rray_flip() reverses the elements of an rray along a single dimension.

Usage

rray_flip(x, axis)

Arguments

x

An rray.

axis

An integer of size 1 specifying the dimension to flip.

Value

x but with reversed elements along axis.

Details

Dimension names are flipped as well.

Examples

Run this code
# NOT RUN {
x <- rray(1:10, c(5, 2))
x <- rray_set_row_names(x, letters[1:5])
x <- rray_set_col_names(x, c("c1", "c2"))

rray_flip(x, 1)

rray_flip(x, 2)

# }

Run the code above in your browser using DataLab