HDF5Array (version 1.0.2)

DelayedArray-utils: Common operations on DelayedArray objects

Description

Common operations on DelayedArray objects.

Arguments

Details

The operations currently supported by DelayedArray objects are:

Delayed operations:

  • all the members of the Ops, Math, and Math2 groups
  • is.na, !
  • pmax2 and pmin2
  • rbind and cbind (documented in cbind)

Block-processed operations:

  • anyNA
  • all the members of the Summary group
  • mean
  • apply
  • rowSums, colSums, rowMeans, and colMeans [DelayedMatrix objects only]
  • matrix multiplication (%*%) of an ordinary matrix by a DelayedMatrix object

See Also

Examples

Run this code
library(rhdf5)
toy_h5 <- system.file("extdata", "toy.h5", package="HDF5Array")
h5ls(toy_h5)

M1 <- HDF5Array(toy_h5, "M1")
range(M1)
M1 >= 0.5 & M1 < 0.75
log(M1)

M2 <- HDF5Array(toy_h5, "M2")
pmax2(M2, 0)

M <- rbind(M1, t(M2))
M
colMeans(M)

## Matrix multiplication writes a new HDF5 dataset to disk and returns
## an HDF5Matrix object that points to this new dataset.
m <- matrix(runif(60), ncol=12)
M <- DelayedArray(matrix(runif(240), nrow=12))

getHDF5DumpFile()  # HDF5 file where the new dataset will be written
lsHDF5DumpFile()
P <- m %*% M
P
getHDF5DumpFile()
lsHDF5DumpFile()

Run the code above in your browser using DataCamp Workspace