Skip to contents

Converts a sparse matrix into an FBM with efficient memory usage.

Usage

sparse_to_fbm(s_mat)

Arguments

s_mat

A sparse matrix.

Value

An FBM object from the bigstatsr package.

Examples

s_mat <- Matrix::rsparsematrix(nrow = 10, ncol = 5, density = 0.3)
# Convert the sparse matrix to an FBM using your function
fbm_mat <- sparse_to_fbm(s_mat)
fbm_mat
#> A Filebacked Big Matrix of type 'double' with 10 rows and 5 columns.