sl.dim: Dimension of Array or Vector

sl.dimR Documentation

Dimension of Array or Vector

Description

Simple function to extend the functionality of dim to work also with vectors (returning a single integer in that case).

Usage

sl.dim(x)

Arguments

x

an array or vector with arbitrary (N) dimensions.

Value

A vector of length N with elements giving the sizes of the dimensions of x.

Author(s)

Helge Goessling

Examples

sl.dim(array(1:24,dim=c(4,3,2)))
## Should return:
## [1] 4 3 2

sl.dim(1:24)
## Should return:
## [1] 24

## Note that the second example does not work if dim() is used instead of sl.dim().

FESOM/spheRlab documentation built on April 6, 2024, 6:52 p.m.