Coerce x to an rray. It will keep its dimensions and dimension names if it has any.

as_rray(x)

Arguments

x

An object to coerce to an rray.

Value

An rray.

Examples

as_rray(1)
#> <rray<dbl>[1]> #> [1] 1
ex <- matrix(1:10, nrow = 5, dimnames = list(NULL, c("a", "b"))) as_rray(ex)
#> <rray<int>[,2][5]> #> a b #> [1,] 1 6 #> [2,] 2 7 #> [3,] 3 8 #> [4,] 4 9 #> [5,] 5 10