fm.get.elesR Documentation

Get a submatrix from a FlashR matrix

Description

fm.get.rows gets specified rows in a FlashR matrix. fm.get.cols gets specified columns in a FlashR matrix. fm.get.eles.vec gets specified elements from a FlashR vector.

Usage

fm.get.cols(fm, idxs)

fm.get.rows(fm, idxs)

fm.get.eles.vec(fm, idxs)

Arguments

fm

A FlashR matrix

idxs

an array of column indices in fm.

Value

a FlashR vector if getting one row or column; a FlashR matrix if getting more than one row or column.

Author(s)

Da Zheng <dzheng5@jhu.edu>

Examples

mat <- fm.runif.matrix(100, 10)
sub <- fm.get.cols(mat, as.integer(runif(5, min=1, max=10)))
sub <- fm.get.rows(mat, as.integer(runif(5, min=1, max=100)))
vec <- fm.runif(100)
sub <- fm.get.eles.vec(vec, as.integer(runif(5, min=1, max=100)))