keller-mark / pizzarr

Slice into Zarr arrays in R 🍕
https://keller-mark.github.io/pizzarr/
MIT License
27 stars 3 forks source link

Convenience functions for save_array and open_array #63

Closed keller-mark closed 7 months ago

keller-mark commented 7 months ago

Fixes #62 Towards #2

Usage

library(pizzarr)

a <- array(data=1:20, dim=c(2, 10))
z <- zarr_create_array(data=a, shape=dim(a), dtype="<f4", fill_value=NA)
zarr_save_array(file.path("test_data", "test_zarr_save_array.zarr"), z, overwrite = TRUE)

Based on https://zarr.readthedocs.io/en/stable/api/convenience.html#zarr.convenience.save_array and https://zarr.readthedocs.io/en/stable/api/creation.html#zarr.creation.open_array