atleast_2d: View Input as an Array with at Least Two Dimensions.

View source: R/convenience.R

atleast_2dR Documentation

View Input as an Array with at Least Two Dimensions.

Description

Ensure that the input has at least two dimensions.

Usage

atleast_2d(x)

Arguments

x

An appropriate R object supported by dim(), for example a vector, matrix, array, or data.frame.

Value

The same object, but with a "dim" attribute.

Examples

x <- 1:10
x
atleast_2d(x)

ramify documentation built on June 24, 2025, 9:07 a.m.