Learn R Programming

HDF5Array (version 1.0.2)

setHDF5DumpFile: Control the location of automatically created HDF5 datasets

Description

Utility functions to control the location of automatically created HDF5 datasets.

Usage

setHDF5DumpFile(file=paste0(tempfile(), ".h5")) getHDF5DumpFile() lsHDF5DumpFile()
setHDF5DumpName(name) getHDF5DumpName()

Arguments

file
The path to the current output HDF5 file, that is, to the HDF5 file where all newly created datasets shall be written.
name
The name of the next dataset to be written to the current output HDF5 file. This is for a one-time use only.

See Also

Examples

Run this code
getHDF5DumpFile()

## Use setHDF5DumpFile() to change the current output HDF5 file.
## If the specified file exists, then it must be in HDF5 format or
## an error will be raised. If it doesn't exist, then it will be
## created.
#setHDF5DumpFile("path/to/some/HDF5/file")

lsHDF5DumpFile()

a <- array(1:600, c(150, 4))
h5a <- HDF5Dataset(a)
lsHDF5DumpFile()
A <- HDF5Array(h5a)   # DelayedArray object
A

b <- array(runif(6000), c(4, 2, 150))
h5b <- HDF5Dataset(b)
lsHDF5DumpFile()
B <- HDF5Array(h5b)   # DelayedArray object
B

C <- (log(2 * A + 0.88) - 5)^3 * t(drop(B[ , 1, ]))
C
HDF5Dataset(C)        # realize C on disk
lsHDF5DumpFile()

## Matrix multiplication is not delayed:
P <- C %*% matrix(runif(20), nrow=4)
lsHDF5DumpFile()

Run the code above in your browser using DataLab