saveDelayedObject,array-method | R Documentation |
Methods to save simple seed classes - namely, ordinary matrices or sparse Matrix objects - into the delayed operation file. See “Dense arrays” and “Sparse matrices” at https://artifactdb.github.io/chihaya/ for more details.
## S4 method for signature 'array'
saveDelayedObject(x, file, name)
## S4 method for signature 'CsparseMatrix'
saveDelayedObject(x, file, name)
x |
An R object of the indicated class. |
file |
String containing the path to a HDF5 file. |
name |
String containing the name of the group to save into. |
For string arrays, missing values are handled by the "missing-value-placeholder"
attribute on the data
dataset.
All NA
values in the array are replaced by the placeholder value in the attribute when they are saved inside the HDF5 file.
If this attribute is not present, it can be assumed that all strings are non-missing.
A NULL
, invisibly.
A group is created at name
containing the contents of x
.
Aaron Lun
# Saving an ordinary matrix.
X <- matrix(rpois(100, 2), 5, 20)
Y <- DelayedArray(X)
temp <- tempfile(fileext=".h5")
saveDelayed(Y, temp)
rhdf5::h5ls(temp)
loadDelayed(temp)
# Saving a sparse matrix.
X <- rsparsematrix(100, 20, 0.1)
Y <- DelayedArray(X)
temp <- tempfile(fileext=".h5")
saveDelayed(Y, temp)
rhdf5::h5ls(temp)
loadDelayed(temp)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.