zeros: Create a zero matrix.

View source: R/utils.R

zerosR Documentation

Create a zero matrix.

Description

Inspired by MatLab's zeros function to easily create a multi-dimensional array populated with zeros.

Usage

zeros(dims)

Arguments

dims

A numeric vector representing the dimensions of the array.

Value

A multi-dimensional array of zeros.

Examples


# Create a 10-row by 2-column matrix of zeros
zeros(dims = c(10, 2))

# Create a 3-d array with 10-rows and 2-columns
zeros(dims = c(3, 10, 2))

jdtrat/rlsims documentation built on March 26, 2022, 6:17 p.m.