| h5_names | R Documentation |
Returns the names of the object.
For Groups, it returns the names of the objects contained in the group (similar to ls()).
For Compound Datasets (data.frames), it returns the column names.
For other Datasets, it looks for a dimension scale and returns it if found.
h5_names(file, name = "/", attr = NULL)
file |
The path to the HDF5 file. |
name |
The full path of the object. |
attr |
The name of an attribute. If provided, returns the names associated with the attribute
(e.g., field names if the attribute is a compound type). (Default: |
A character vector of names, or NULL if the object has no names.
file <- tempfile(fileext = ".h5")
h5_write(data.frame(x=1, y=2), file, "df")
h5_names(file, "df") # "x" "y"
x <- 1:5
names(x) <- letters[1:5]
h5_write(x, file, "x")
h5_names(file, "x") # "a" "b" "c" "d" "e"
h5_write(mtcars[,c("mpg", "hp")], file, "dset")
h5_names(file, "dset") # "mpg" "hp"
unlink(file)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.