if (FALSE) {
library(BigDataStatMeth)
# Create identity matrix (1M x 1M)
bdCreate_diagonal_hdf5("identity.h5", "/", "I_matrix",
size = 1000000, scalar = 1.0)
# Create scaled identity vector (more efficient)
bdCreate_diagonal_hdf5("scaled_id.h5", "/", "scaled_I",
size = 500000, scalar = 3.14,
output_type = "vector")
# Create custom diagonal matrix
custom_diag <- runif(10000)
bdCreate_diagonal_hdf5("custom.h5", "/", "my_diag",
diagonal_values = custom_diag,
scalar = 2.0, output_type = "matrix")
# Create custom diagonal vector (most efficient)
bdCreate_diagonal_hdf5("custom_vec.h5", "/", "my_diag_vec",
diagonal_values = custom_diag,
output_type = "vector")
}
Run the code above in your browser using DataLab