dims

0th

Percentile

Vector dimensions

  • vec_empty() returns TRUE if vec_size() is zero.

  • vec_dims() gives the dimensionality (i.e. number of dimensions)

  • vec_dim() returns the size of each dimension

Usage
vec_empty(x)

vec_dim(x)

vec_dims(x)

Arguments
x

A vector

Details

Unlike base R, we treat vectors with NULL dimensions as 1d. This simplifies the type system by eliding a special case. Compared to base R equivalent, vec_dim() returns length(), not NULL, when x is 1d.

Aliases
  • dims
  • vec_empty
  • vec_dim
  • vec_dims
Examples
# NOT RUN {
# Compared to base R
x <- 1:5
dim(x)
vec_dim(x)
# }
Documentation reproduced from package vctrs, version 0.1.0, License: GPL-3

Community examples

Looks like there are no examples yet.