| diag_scale | R Documentation |
Applies a scalar arithmetic operation to the diagonal elements of an
HDF5Matrix. Off-diagonal elements are not modified.
Delegates to bdDiag_scalar_hdf5().
diag_scale(x, scalar, op = "multiply", ...)
## S3 method for class 'HDF5Matrix'
diag_scale(
x,
scalar,
op = "multiply",
outgroup = NULL,
outdataset = NULL,
overwrite = FALSE,
...
)
x |
An |
scalar |
Numeric scalar. |
op |
Operation: |
... |
Additional arguments passed to |
outgroup |
Character or |
outdataset |
Character or |
overwrite |
Logical. If |
A new HDF5Matrix.
diag_op
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.