Convert a sparse matrix into a file-backed matrix (FBM
)
Source: R/anglemanise_utils.R
sparse_to_fbm.Rd
Converts a sparse matrix into an FBM
with efficient
memory usage.
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.