readColMM: readColMM

View source: R/read-col-mm.R

readColMMR Documentation

readColMM

Description

Modified the 'Matrix::readMM' function for reading matrices stored in the Harwell-Boeing or MatrixMarket formats but only reads selected column.

Usage

readColMM(file, which.col, chunk = 1000L)

Arguments

file

the name of the file to be read from as a character scalar. Those storing matrices in the MatrixMarket format usually end in ".mtx".

which.col

An integer scalar, the column index

chunk,

An integer scalar indicating the chunk size to use, i.e., number of rows to read at any one time.

Details

See readMM

Value

A sparse matrix object that inherits from the "Matrix" class which the original dimensions.To get the vector of the specified column, one need to subset the matrix to select the column with the same index.

Author(s)

Ruqian Lyu

Examples

demo_path <-paste0(system.file("extdata",package = "comapr"),"/")
readColMM(file = paste0(demo_path,"s1_chr1_vi.mtx"), which.col=2,chunk=2)

ruqianl/comapr documentation built on Oct. 27, 2023, 5:12 a.m.