matrixR Documentation

Matrices

Description

fm.matrix creates a matrix from the given set of values. as.matrix attempts to turn a FlashR matrix to an R matrix. fm.as.matrix attempts to turn its argument into a FlashR matrix. fm.is.matrix indicates whether a FlashR object is a matrix.

Usage

## S4 method for signature 'fm'
as.matrix(x)

## S4 method for signature 'fmV'
as.matrix(x)

fm.is.matrix(fm)

fm.as.matrix(x)

fm.matrix(vec, nrow, ncol, byrow = FALSE)

Arguments

x

an R object

vec

an R data vector.

nrow

the desired number of rows.

ncol

the desired number of columns.

byrow

logical. If FALSE (the default) the matrix is filled by columns, otherwise the matrix is filled by rows.

Details

Currently, fm.matrix takes an R vector or a FlashR vector as input and the length of the vector must be the same as the number of rows if byrow is FALSE or the same as the number of columns if byrow is TRUE.

Examples

mat <- fm.matrix(runif(100), 100, 2)
mat <- as.matrix(fm.runif.matrix(100, 2))
mat <- fm.as.matrix(matrix(runif(200), 100, 2))
res <- fm.is.matrix(mat)