FBM)R/anglemanise_utils.R
sparse_to_fbm.RdConverts a sparse matrix into an FBM with efficient
memory usage.
sparse_to_fbm(s_mat)An FBM object from the bigstatsr
package.
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.