Skip to content

Commit 459fb79

Browse files
committed
Added note on writing subsets
1 parent 318eded commit 459fb79

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

on-disk-data/03-on-disk.Rmd

+12
Original file line numberDiff line numberDiff line change
@@ -98,4 +98,16 @@ system.time( h5read(file = "../data/on-disk-data/one_chunk.h5", name = "/one_chu
9898

9999
We can also look at the file size to get an idea of how the compression is affected.
100100

101+
## Writing subsets
102+
103+
We can use the `index` syntax to write subsets of a dataset.
104+
105+
```{r}
106+
h5write(rep(1000, nrow(brain_10k)), file = "../data/on-disk-data/one_chunk.h5", name = "one_chunk", index = list(NULL, 1))
107+
HDF5Array(file = "../data/on-disk-data/one_chunk.h5", name = "/one_chunk")
108+
```
109+
110+
It's not always necessary to delete datasets, but be aware of type conversions (or lack of!)
111+
112+
101113

0 commit comments

Comments
 (0)