as.matrix.hdf5.dataset {rhdf5}R Documentation

Coerce an HDF5 dataset to be an R matrix.

Description

If an object of class hdf5.dataset has dimension two then it can be coerced into an R matrix. This function carries out the coercion. Be careful though as these can be very large.

Usage

as.matrix.hdf5.dataset(x)

Arguments

x An object of class hdf5.dataset.

Details

The coercion may require a type coercion from the specific HDF5 type to one of the standard R types (such as integer or double).

Value

A duplicate of x as an R object if x has dimension two.

Author(s)

R. Gentleman

See Also

is.matrix.hdf5.dataset

Examples

## Not run: 
    mad <- hdf5.open("microarray.h5")
    x1 <- hdf5.dataset(mad, "asmat", dim=c(31, 12))
    set.seed(777)
    x1[] <- rexp(372,4)
    y <- as.matrix(x1)
## End(Not run)

[Package rhdf5 version 1.4.0 Index]