Learn R Programming

rtemis (version 0.79)

size: 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)

Examples

Run this code
# NOT RUN {
x <- rnorm(20)
size(x)
# 20  1

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

Run the code above in your browser using DataLab