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

dimension

Gets the dimension of the object


Description

Gets the dimension of the object similar to what dim() does, but instead of NULL it will return the length of a vector. If a function is passed, NULL is returned.

Usage

## Default S3 method:
dimension(object, ...)

Arguments

object

The object for which the dimension should be obtained.

...

Not used.

Value

Returns an integer vector or NULL.

Author(s)

Henrik Bengtsson

See Also

ll.default(). dim() and length().

Examples

dimension(matrix(1:100, ncol=10))     # 10 10
  dimension(1:14)                       # 14
  dimension(data.frame(a=1:10, b=10:1)) # 10  2
  dimension(print)                      # NULL

R.oo

R Object-Oriented Programming with or without References

v1.24.0
LGPL (>= 2.1)
Authors
Henrik Bengtsson [aut, cre, cph]
Initial release

We don't support your browser anymore

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