Learn R Programming

cwhmisc (version 5.0)

Dim: dim of vectors and arrays

Description

Get length of vectors and dimension of arrays in a unified manner.

Usage

Dim(x)

Arguments

x
vector or array

Value

  • Integer vector containing length of vector or dimension of array.

Examples

Run this code
x <- matrix(1:12,3,4)
  Dim(x)  #   3 4
  y <- rep(0,5)
  Dim(y)  # 5

Run the code above in your browser using DataLab