dim: Function to return dimensions of arguments, or lengths if...

View source: R/dim.R

dimR Documentation

Function to return dimensions of arguments, or lengths if dim==NULL.

Description

Simple overload to return dim when it's sensible and length otherwise

Usage

dim(item)

Arguments

item

The object whose dimensions are to be determined

Value

Either a single value as returned by length or a vector of integers indicating the magnitude of each dimension as returned by dim

Author(s)

Carl Witthoft, carl@witthoft.com

See Also

dim , length,

Examples

x1<-1:10
x2<-matrix(1,3,4)
dim(x1)
dim(x2)

cgwtools documentation built on Oct. 21, 2023, 1:06 a.m.