| h5_create_file | R Documentation |
Explicitly creates a new, empty HDF5 file.
h5_create_file(file)
file |
Path to the HDF5 file to be created. |
This function is a simple wrapper around h5_create_group(file, "/").
Its main purpose is to allow for explicit file creation in code.
Note that calling this function is almost always unnecessary, as all
h5lite writing functions (like h5_write() or
h5_create_group()) will automatically create
the file if it does not exist.
It is provided as a convenience for users who prefer to explicitly create a file before writing data to it.
Invisibly returns NULL. This function is called for its side
effects.
If file does not exist, it will be created as a new, empty HDF5 file.
If file already exists and is a valid HDF5 file, this function does
nothing and returns successfully.
If file exists but is not a valid HDF5 file (e.g., a text file),
an error will be thrown and the file will not be modified.
h5_create_group(), h5_write()
file <- tempfile(fileext = ".h5")
# Explicitly create the file
h5_create_file(file)
if (file.exists(file)) {
message("File created successfully.")
}
unlink(file)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.