rray_elems: Compute the number of elements in an array

Description Usage Arguments Value Examples

View source: R/rray.R

Description

rray_elems() computes the number of individual elements in an array. It generally computes the same thing as length(), but has a more predictable name.

Usage

1

Arguments

x

A vector, matrix, array or rray.

Value

A single integer. The number of elements in x.

Examples

1
2
3
4
5
6
7
8
9
rray_elems(1:5)

rray_elems(matrix(1, 2, 2))

# It is different from `vec_size()`,
# which only returns the number of
# observations
library(vctrs)
vec_size(matrix(1, 2, 2))

DavisVaughan/rray documentation built on Feb. 5, 2020, 10:06 p.m.