undim {str2str} | R Documentation |
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)
[Package str2str version 1.0.0 Index]