ensuredim {arrayhelpers}R Documentation

Enforce array and convert to vector if appropriate

Description

ensuredim turns vectors into 1d-arrays, and leaves arrays unchanged. drop1d is the inverse: it converts 1d arrays into vectors.

Usage

ensuredim(x)

drop1d(x, drop = TRUE)

Arguments

x

vector (or array)

drop

if TRUE, 1d arrays are converted into vectors

Value

esuredim array of at least one dimension

drop1d vector, if x had only 1 dimension

Author(s)

Claudia Beleites

Claudia Beleites


[Package arrayhelpers version 1.1-0 Index]