sl.dim: Dimension of Array or Vector

Description Usage Arguments Value Author(s) Examples

View source: R/sl.dim.R

Description

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

Usage

1
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

1
2
3
4
5
6
7
8
9
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().

helgegoessling/spheRlab documentation built on Sept. 29, 2017, 6:36 a.m.