new_rray: Create a new rray

Description Usage Arguments Value Examples

View source: R/rray.R

Description

Low level constructor for rray objects

Usage

1
2
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

1
2
3
4
5
6
7
8
rray_ex <- new_rray(
  .data = 1:10,
  size = 5L,
  shape = 2L,
  dim_names = list(character(), c("a", "b"))
)

rray_ex

rray documentation built on July 23, 2019, 5:04 p.m.