Writes a zlib-compressed, C-order Zarr v2 array of doubles into dir
and returns the path, ready for altarr_zarr_v2(). The store is made on
demand rather than shipped, because Zarr v2 metadata files (.zarray)
are hidden files, which R packages should not carry.
Details
Every value is its own 0-based position in R's column-major order, so a
result can be checked by eye: in the array returned by
altarr_zarr_v2(), element x[i, j, k] is
(i - 1) + dim[1] * (j - 1) + dim[1] * dim[2] * (k - 1), and x[n] is
n - 1.
Examples
path <- altarr_example_zarr()
x <- altarr_zarr_v2(path)
dim(x)
#> [1] 70 50 30
x[c(1, 2, 71)] # 0, 1, 70
#> [1] 0 1 70