mem_matrix_from: Convert R Matrix to System Memory Mapped Matrix

View source: R/utils.R

mem_matrix_fromR Documentation

Convert R Matrix to System Memory Mapped Matrix

Description

Writes a numeric matrix to a binary memory-mapped file on disk and returns a MemoryMappedMatrix handle pointing to it.

Usage

mem_matrix_from(mat, filename)

Arguments

mat

A numeric matrix.

filename

String destination file path.

Value

A MemoryMappedMatrix / mmap_matrix object backed by filename.

References

F. Scheidt, J. Machkour, and M. Muma, "Solving FDR-Controlled Sparse Regression Problems with Five Million Variables on a Laptop," in Proc. IEEE 9th Int. Workshop Comput. Adv. Multi-Sensor Adapt. Process. (CAMSAP), 2023, pp. 116-120.

See Also

Other memory-mapped matrices: [.mmap_matrix(), as.matrix.mmap_matrix(), dim.mmap_matrix(), mem_matrix(), print.mmap_matrix()

Examples


mat <- matrix(as.double(1:20), nrow = 4, ncol = 5)
f <- tempfile(fileext = ".bin")
on.exit(unlink(f), add = TRUE)
mm <- mem_matrix_from(mat, f)
print(mm)



TRexSelector documentation built on Nov. 20, 2026, 5:09 p.m.