nimbleDim: return sizes of an object whether it is a vector, matrix or...

Description Usage Arguments Value Author(s) Examples

Description

R's regular dim function returns NULL for a vector. It is useful to have this function that treats a vector similarly to a matrix or array. Works in R and NIMBLE. In NIMBLE dim is identical to nimbleDim, not to R's dim

Usage

1
nimbleDim(obj)

Arguments

obj

objects for which the sizes are requested

Value

a vector of sizes in each dimension

Author(s)

NIMBLE development team

Examples

1
2
3
4
5
6
x <- rnorm(4)
dim(x)
nimbleDim(x)
y <- matrix(x, nrow = 2)
dim(y)
nimbleDim(y)

thirdwing/nimble documentation built on May 31, 2019, 10:41 a.m.