saveDelayedObject,ANY-method | R Documentation |
Optional methods to save other classes, depending on the availability of the packages in the current R installation.
## S4 method for signature 'ANY'
saveDelayedObject(x, file, name)
x |
An R object of a supported class, see Details. |
file |
String containing the path to a HDF5 file. |
name |
String containing the name of the group to save into. |
The ANY method will dispatch to classes that are implemented in other packages:
If x
is a LowRankMatrixSeed from the BiocSingular package, it is handled as a delayed matrix product.
If x
is a ResidualMatrixSeed from the ResidualMatrix package, it is converted into the corresponding series of delayed operations.
However, the top-level group will contain a "r_type_hint"
dataset to indicate that it was originally a ResidualMatrix object.
This provides R clients with the opportunity to reload it as a ResidualMatrix, which may be more efficient than the naive DelayedArray representation.
Otherwise, if x
comes from package Y, we will try to load chihaya.Y.
This is assumed to define an appropriate saveDelayedObject
method for x
.
A NULL
, invisibly.
A group is created at name
containing the contents of x
.
Aaron Lun
# Saving a matrix product.
library(BiocSingular)
left <- matrix(rnorm(100000), ncol=20)
right <- matrix(rnorm(50000), ncol=20)
thing <- LowRankMatrix(left, right)
temp <- tempfile()
saveDelayed(thing, temp)
rhdf5::h5ls(temp)
loadDelayed(temp)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.