zeros: Zero Vector/Matrix

Description Usage Arguments Details Author(s) Examples

View source: R/zeros.R

Description

Returns a vector or 2D matrix of zeros of the same shape as the input.

Usage

1
zeros (x,y=0)

Arguments

x

A scalar, vector, or two dimensional matrix.

y

An optional parameter to create a 2D matrix.

Details

If a scalar value is given, a vector of that many zeros is returned. If the y parameter is also specified, a matrix is returned with x rows and y columns.

If a vector is given, a vector of zeros of the same length is returned.

If a 2D matrix or dataframe is given, a matrix of zeros with the name number of rows and columns is returned.

Author(s)

Santiago Barreda <[email protected]>

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## A vector 
zeros (5)
## A matrix
zeros (5, 3)

## Copy an existing vector
zeros (1:10)

## Copy an existing matrix
samplematrix = 1:10 
zeros (samplematrix)

phonTools documentation built on May 29, 2017, 9 a.m.