file <- tempfile(fileext = ".h5")
h5_create_file(file)
# Create some data and attributes
h5_write(matrix(1:10, 2, 5), file, "matrix")
h5_write("A note", file, "matrix", attr = "note")
# Review the file structure
h5_str(file)
# Delete the attribute
h5_delete(file, "matrix", attr = "note")
# Review the file structure
h5_str(file)
# Delete the dataset
h5_delete(file, "matrix")
# Review the file structure
h5_str(file)
# Cleaning up
unlink(file)
Run the code above in your browser using DataLab