Low level constructor for rray objects
new_rray(.data = numeric(0), size = 0L, shape = integer(0), dim_names = NULL, ..., subclass = character(0))
.data | A numeric vector with no attributes representing the data. |
---|---|
size | An integer. The number of observations in the object. This is equivalent to the number of rows. |
shape | An integer vector. The shape corresponds to all of the
dimensions in the object except for the first one (the |
dim_names | A list. For no names, |
... | Name-value pairs defining attributes. |
subclass | The name of the subclass. |
A new rray.
rray_ex <- new_rray( .data = 1:10, size = 5L, shape = 2L, dim_names = list(character(), c("a", "b")) ) rray_ex#> <rray<int>[,2][5]> #> a b #> [1,] 1 6 #> [2,] 2 7 #> [3,] 3 8 #> [4,] 4 9 #> [5,] 5 10