dims {Zelig} | R Documentation |
Retrieve or set the dimensions of a vector, array, or data frame.
dims(x) dims(x) <- value
x |
An R object. For example, a vector, matrix, array, or data frame. |
value |
For the default method, either NULL or a numeric
vector coerced to integer (by truncation). |
The function dims
performs exactly the same as dim
, and
additionally returns the length
of vectors (treating them as
one-dimensional arrays).
Olivia Lau <olau@fas.harvard.edu>
dim
, length
a <- 1:12 dims(a) a <- matrix(1, nrow = 4, ncol = 9) dims(a)