getMatrixBlocks: Get chunked sets of row-wise or column-wise indices of a...

Description Usage Arguments Value Examples

View source: R/sparseToDenseMatrix.R

Description

Get chunked sets of row-wise or column-wise indices of a matrix

Usage

1
2
getMatrixBlocks(mat, chunk.size = 1e+05, by.row = TRUE,
  by.col = FALSE)

Arguments

mat

Input matrix

chunk.size

The size of the chunks to use for coercion

by.row

Whether to chunk in a row-wise fashion

by.col

Whether to chunk in a column-wise fashion

Value

A set of chunked indices

Examples

1
2
3
4
5
6
7
8
9
#make a sparse binary matrix
library(Matrix)
m <- 100
n <- 1000
mat <- round(matrix(runif(m*n), m, n))
mat.sparse <- Matrix(mat, sparse = TRUE)

#get row-wise chunks of 10
chunks <- getMatrixBlocks(mat.sparse, chunk.size = 10)

biobenkj/sparseMatrixUtils documentation built on Nov. 4, 2019, 7:19 a.m.