size: Size of matrix or vector

View source: R/size.R

sizeR Documentation

Size of matrix or vector

Description

Return the size of a matrix or vector as (Nrows, Ncolumns) Are you tired of getting NULL when you run dim() on a vector?

Usage

size(x)

Arguments

x

Vector or matrix input

Value

Integer vector of length 2: c(Nrow, Ncols)

Author(s)

E.D. Gennatas

Examples

x <- rnorm(20)
size(x)
# 20  1

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

egenn/rtemis documentation built on Oct. 28, 2024, 6:30 a.m.