Write a compressed MatrixMarket file
writeMMgz.Rd
This function writes a sparse matrix in the MatrixMarket format to a compressed .gz
file.
The function handles both real and integer matrix types.
Arguments
- x
A sparse matrix (typically a
dgCMatrix
orngCMatrix
object).- file
A character string specifying the output file name, which will be compressed into
.gz
format.
Details
This function writes the matrix in the MatrixMarket coordinate format.
It first writes the header indicating the matrix type and size, and then appends the matrix data.
If the matrix is an ngCMatrix
, it is treated as an integer matrix, otherwise as a real matrix.
The function compresses the output into a .gz
file.