Learn R Programming

hdf5r (version 1.3.11)

H5T_COMPOUND-class: Class for HDF5 compound datatypes.

Description

Inherits from class H5T.

Arguments

Value

Object of class H5T_COMPOUND.

Methods

new(labels, dtypes, size = NULL, offset = NULL, id = NULL)

Create at compound type that is the HDF5 equivalent of a table

Parameters

labels

The labels of the columns of the compound object

dtypes

The datatypes of the columns of the object; this is usually a list of objects of class H5T

size

The size of each datatype; if NULL, automatically inferred

offset

The offset where each datatype starts; can be different from the sum of the individual sizes so that datatypes are aligned with memory addresses. If NULL, inferred automatically

id

Internal use only

pack()

This function implements the HDF5-API function H5Tpack. Please see the documentation at https://docs.hdfgroup.org/hdf5/v1_10/group___h5_t.html for details.

get_cpd_types()

Return H5T objects that represent the datatypes of the columns of the compound object. Returned as a list if more than 1

get_cpd_labels()

Return the labels of the columns as a character vector

get_cpd_classes()

Return the classes of the columns as an object of type factor_ext

get_cpd_offsets()

Return the offsets of the datatypes

describe()

Print a detailed description of the datatype; this is experimental

Author

Holger Hoefling

See Also

H5T

Examples

Run this code
# create a H5T_COMPOUND  corresponding to a data-frame
my_cpd <- H5T_COMPOUND$new(c("name", "age", "salary"),
    dtypes=list(H5T_STRING$new(size=200), h5types$H5T_NATIVE_INT, h5types$H5T_NATIVE_DOUBLE))
my_cpd

Run the code above in your browser using DataLab