dims {Zelig}R Documentation

Return Dimensions of Vectors, Arrays, and Data Frames

Description

Retrieve or set the dimensions of a vector, array, or data frame.

Usage

dims(x)
dims(x) <- value

Arguments

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).

Value

The function dims performs exactly the same as dim, and additionally returns the length of vectors (treating them as one-dimensional arrays).

Author(s)

Olivia Lau <olau@fas.harvard.edu>

See Also

dim, length

Examples

a <- 1:12
dims(a)

a <- matrix(1, nrow = 4, ncol = 9)
dims(a)

[Package Zelig version 2.0-13 Index]