Learn R Programming

ramify (version 0.4.0)

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

Description

Ensure that the input has at least two dimensions.

Usage

atleast_2d(x)

Value

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

Arguments

x

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

Examples

Run this code
x <- 1:10
x
atleast_2d(x)

Run the code above in your browser using DataLab