Skip to contents

Returns the size of an object

Usage

size(x, verbosity = 1L)

Arguments

x

any object with length() or dim().

verbosity

Integer: Verbosity level. If > 0, print size to console

Value

Integer vector with length equal to the number of dimensions of x, invisibly.

Details

If dim(x) is NULL, returns length(x).

Author

EDG

Examples

x <- rnorm(20)
size(x)
#> 20 
# 20
x <- matrix(rnorm(100), 20, 5)
size(x)
#> 20 x 5 
# 20  5