Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

ndim

Number of Object Dimensions


Description

ndim returns the number of dimensions an object has. This is most useful for arrays, which can have anywhere from 1 to 1000+ dimensions.

Usage

ndim(x)

Arguments

x

object that has dimensions (e.g., array).

Details

ndim is a very simple function that is simply length(dim(x)).

Value

integer vector of length 1 specifying the number of dimensions in x. If x does not have any dimensions, then O is returned.

Examples

ndim(state.region)
ndim(attitude)
ndim(HairEyeColor)

str2str

Convert R Objects from One Structure to Another

v0.1.1
GPL (>= 2)
Authors
David Disabato [aut, cre]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.