ezMatrix: Creates a matrix

View source: R/util.R

ezMatrixR Documentation

Creates a matrix

Description

Either use the rows and columns to define the matrix or the dimensions.

Usage

ezMatrix(x, rows = NULL, cols = NULL, dim = NULL)

Arguments

x

a vector containing the matrix elements

rows

a vector, whose length defines the number of rows.

cols

a vector, whose length defines the number of columns.

dim

a vector of length 2 defining the dimensions of the matrix.

Value

Returns a matrix with rows and cols defining the names or using generic ones, if dim is used instead.

Author(s)

Rehrauer, Hubert

Schmid, Peter

Examples

ezMatrix(1,rows=1:4,cols=1:3)
ezMatrix(3:6,dim=c(4,6))

uzh/ezRun documentation built on Dec. 26, 2024, 9:53 a.m.