Learn R Programming

universals (version 0.0.1)

dims: Dimensions

Description

Gets the dimensions of an object.

Usage

dims(x, ...)

# S3 method for default dims(x, ...)

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

Arguments

x

An object.

...

Other arguments passed to methods.

Value

An integer vector of the dimensions.

Details

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

See Also

base::dim()

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

Examples

Run this code
# NOT RUN {
dims(character(0))
dims(1:3)
dims(iris)
dims(Titanic)
dims(factor("a"))
# }

Run the code above in your browser using DataLab