info: info gets the dimension or length of a matrix, array,...

View source: R/rutils.R

infoR Documentation

info gets the dimension or length of a matrix, array, data.frame or list

Description

info gets the dimension or length of a matrix, array, data.frame or list. It is safer than dim because if the object is a list dim fails.

Usage

info(invar, verbose = FALSE)

Arguments

invar

an object that is either a matrix, an array, a data.frame or a list

verbose

should the head of the object be printed to console. default=FALSE

Value

the dimensions of the object

Examples

x <- array(rnorm(125,mean=5,sd=1),dim=c(5,5,5))
info(x,FALSE)
x <- list(x=5,y=6,z=7)
info(x)

haddonm/codeutils documentation built on April 15, 2024, 1:02 p.m.