Learn R Programming

ramify (version 0.3.3)

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)

Arguments

x
An R object, for example a vector, matrix, array, or data frame.

Value

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

Examples

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

Run the code above in your browser using DataLab