[ top | up ]

Array Extents

Syntax

dim(x)
dim(x) <- values

Value

This function retrieves the vector of extents of the array given as its argument. The second form above is used to shape a vector as an array by specifying its extents.

See Also

ncol, nrow.

Examples

# simple versions of nrow and ncol # could be defined as follows nrow <- function(x) dim(x)[1] ncol <- function(x) dim(x)[2]