dims {universals}R Documentation

Dimensions

Description

Gets the dimensions of an object.

Usage

dims(x, ...)

## Default S3 method:
dims(x, ...)

## S3 method for class 'factor'
dims(x, ...)

Arguments

x

An object.

...

Other arguments passed to methods.

Details

Unlike base::dim(), dims returns the length of an atomic vector.

Value

An integer vector of the dimensions.

See Also

base::dim()

Other dimensions: ndims(), npdims(), pdims()

Examples

dims(numeric(0))
dims(1:3)
dims(factor("a"))
dims(matrix(1:4, nrow = 2L))
dims(array(1:9, dim = c(3L,1L,3L)))
dims(ToothGrowth)
dims(Titanic)

[Package universals version 0.0.5 Index]