Low level constructor for rray objects

new_rray(.data = numeric(0), size = 0L, shape = integer(0),
  dim_names = NULL, ..., subclass = character(0))

Arguments

.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 size).

dim_names

A list. For no names, NULL, in which case a list of empty characters will be constructed. Otherwise the list must be the same length as the total number of dimensions (i.e length(c(size, shape))). Each element of the list much be either a character vector the same size as the corresponding dimension, or character(0) for no names for that dimension.

...

Name-value pairs defining attributes.

subclass

The name of the subclass.

Value

A new rray.

Examples

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