Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

realize

Realize a DelayedArray object


Description

Realize a DelayedArray object in memory or on disk.

Usage

realize(x, ...)

## S4 method for signature 'ANY'
realize(x, BACKEND=getAutoRealizationBackend())

Arguments

x

The array-like object to realize.

...

Additional arguments passed to methods.

BACKEND

A single string specifying the name of the realization backend. Use the current automatic realization backend by default i.e. the backend returned by getAutoRealizationBackend().

Value

A DelayedArray object. More precisely, it returns DelayedArray(as.array(x)) when the backend is set to NULL (the default). Otherwise it returns an instance of the class associated with the specified backend (which should extend DelayedArray).

See Also

Examples

library(HDF5Array)
toy_h5 <- system.file("extdata", "toy.h5", package="HDF5Array")
h5ls(toy_h5)
M1 <- HDF5Array(toy_h5, "M1")
M2 <- HDF5Array(toy_h5, "M2")
M3 <- rbind(log(M1), t(M2))

supportedRealizationBackends()
getAutoRealizationBackend()  # backend is set to NULL
realize(M3)  # realization as ordinary array

setAutoRealizationBackend("RleArray")
getAutoRealizationBackend()  # backend is set to "RleArray"
realize(M3)  # realization as RleArray object

setAutoRealizationBackend("HDF5Array")
getAutoRealizationBackend()  # backend is set to "HDF5Array"
realize(M3)  # realization in HDF5 file

DelayedArray

A unified framework for working transparently with on-disk and in-memory array-like datasets

v0.16.3
Artistic-2.0
Authors
Hervé Pagès <hpages.on.github@gmail.com>, with contributions from Peter Hickey <peter.hickey@gmail.com> and Aaron Lun <infinite.monkeys.with.keyboards@gmail.com>
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.