fm.rsparse.projR Documentation

Create a sparse projection matrix.

Description

fm.rsparse.proj creates a sparse projection matrix stored in memory.

Usage

fm.rsparse.proj(nrow, ncol, density, name = "")

Arguments

nrow

the number of rows in the generated matrix.

ncol

the number of columns in the generated matrix.

density

the ratio of non-zero entries to the total number of elements.

name

the name of the matrix. It's stored on disks, it's used as the file name.

Details

The non-zero values in the sparse projection matrix are either 1 or -1. Their values are uniformly randomly chosen to be 1 or -1.

Value

a FlashR matrix.

Examples

mat <- fm.rsparse.proj(10000, 100, 0.001) # a sparse projection matrix.