Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

undim

Undimension an Object


Description

undim removes all dimensions from an object. This is particularly useful for simplifying 1D arrays where the dimnames from the array are used for the returned object. Although the function can also be used when dimensions were temporarily (or erroneously) given to an object.

Usage

undim(x)

Arguments

x

object with dimensions (usually an array of some kind)

Value

x without any dimensions. If x is an array, then the return object will be an atomic vector. If x is a 1D array, then the returned vector will have names = the 1D dimnames.

Examples

a <- array(NA, dim = 1, dimnames = list("A"))
v <- undim(a)
str(a); str(v)

str2str

Convert R Objects from One Structure to Another

v0.1.1
GPL (>= 2)
Authors
David Disabato [aut, cre]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.