powered by
Applies a scalar arithmetic operation to the diagonal elements of an HDF5Matrix. Off-diagonal elements are not modified. Delegates to bdDiag_scalar_hdf5().
HDF5Matrix
bdDiag_scalar_hdf5()
diag_scale(x, scalar, op = "multiply", ...)# S3 method for HDF5Matrix diag_scale( x, scalar, op = "multiply", outgroup = NULL, outdataset = NULL, overwrite = FALSE, ... )
# S3 method for HDF5Matrix diag_scale( x, scalar, op = "multiply", outgroup = NULL, outdataset = NULL, overwrite = FALSE, ... )
A new HDF5Matrix.
An HDF5Matrix.
Numeric scalar.
Operation: "add", "subtract", "multiply" (default), or "divide".
"add"
"subtract"
"multiply"
"divide"
Additional arguments passed to x$diag_scale(): outgroup, outdataset, overwrite, threads, compression.
x$diag_scale()
outgroup
outdataset
overwrite
threads
compression
Character or NULL. HDF5 group where the result is stored. Default "OUTPUT".
NULL
"OUTPUT"
Character or NULL. Dataset name for the result.
Logical. If TRUE, overwrite the existing result dataset. Default FALSE.
TRUE
FALSE
diag_op
# \donttest{ tmp <- tempfile(fileext = ".h5") M <- hdf5_create_matrix(tmp, "data/M", data = diag(5)) R <- diag_scale(M, scalar = 3, op = "multiply") hdf5_close_all() unlink(tmp) # }
Run the code above in your browser using DataLab