file <- H5File("test.h5")
# Create new DataSet 'testset' in H5Group 'testgroup'
file["testgroup", "testset"] <- matrix(1:9, nrow = 3)
# Create new DataSet 'testset2' in file root
file[, "testset2"] <- 1:10
# Retrieve H5Group 'testgroup'
group <- file["testgroup"]
# Retrieve H5Group 'testset'
dset <- group[,"testset"]
h5close(dset)
h5close(group)
h5close(file)
file.remove("test.h5")
Run the code above in your browser using DataLab