fmm_to_sparse_Matrix {fastMatMR} | R Documentation |
Convert Matrix Market File to Sparse Matrix
Description
This function reads a Matrix Market file and converts it to a sparse matrix in R using the Matrix package.
Usage
fmm_to_sparse_Matrix(filename)
Arguments
filename |
The name of the input Matrix Market file to be read. |
Value
A dgCMatrix object containing the data read from the Matrix Market file.
Examples
# Create
sample_sparse_mat <- Matrix::Matrix(c(1, 0, 0, 2), nrow = 2, sparse = TRUE)
temp_file <- tempfile(fileext = ".mtx")
write_fmm(sample_sparse_mat, temp_file)
# Read
sparse_mat <- fmm_to_sparse_Matrix(temp_file)
[Package fastMatMR version 1.2.5 Index]