Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wrathematics/275576ae638c57d7277fb5188b6be5f3 to your computer and use it in GitHub Desktop.
Save wrathematics/275576ae638c57d7277fb5188b6be5f3 to your computer and use it in GitHub Desktop.
hdfio example
library(memuse)
library(hdfio)
f = nycflights13::flights
for (compression in c(0, 4, 9)){
suppressWarnings(file.remove("flights.h5"))
write_h5df(f, "flights.h5", compression=compression)
print(Sys.filesize("flights.h5"))
}
## 33.072 MiB
## 7.462 MiB
## 7.097 MiB
f = as.data.frame(f)
g = read_h5df("flights.h5")
all.equal(f, g)
## [1] TRUE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment