file <- tempfile(fileext = ".h5")
h5_write(1:10, file, "my_ints", as = "int32")
h5_class(file, "my_ints") # "numeric"
h5_write(mtcars, file, "mtcars")
h5_class(file, "mtcars") # "data.frame"
h5_write(c("a", "b", "c"), file, "strings")
h5_class(file, "strings") # "character"
h5_write(c(1, 2, 3), file, "my_floats", as = "float64")
h5_class(file, "my_floats") # "numeric"
unlink(file)
Run the code above in your browser using DataLab