A Zarr implementation for R.
Installation requires R 4.0.0 or greater.
install.packages("devtools")
devtools::install_github("keller-mark/pizzarr")
library(pizzarr)
a <- array(data=1:20, dim=c(2, 10))
# [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
# [1,] 1 3 5 7 9 11 13 15 17 19
# [2,] 2 4 6 8 10 12 14 16 18 20
z <- zarr_create(shape=dim(a), dtype="<f4", fill_value=NA)
z$set_item("...", a)
selection <- z$get_item(list(slice(1, 2), slice(1, 5)))
print(selection$data)
# [,1] [,2] [,3] [,4] [,5]
# [1,] 1 3 5 7 9
# [2,] 2 4 6 8 10
(This section has been adapted from the Rarr project README).
Store | Status (reading / writing) |
---|---|
MemoryStore |
β / β |
DirectoryStore |
β / β |
HttpStore |
β / β |
Zarr Data Type | Status (reading / writing) |
Notes |
---|---|---|
b1 / boolean |
β / β | Converted to logical in R. |
i1 / int8 |
β / β | Converted to integer in R. |
u1 / uint8 |
β / β | Converted to integer in R. |
i2 / int16 |
β / β | Converted to integer in R. |
u2 / uint16 |
β / β | Converted to integer in R. |
i4 / int32 |
β / β | Converted to integer in R. |
u4 / uint32 |
β / β | Converted to integer in R. |
i8 / int64 |
β / β | Converted to integer in R. |
u8 / uint64 |
β / β | Converted to integer in R. |
f2 / float16 |
β / β | Converted to double in R. |
f4 / float32 |
β / β | Converted to double in R. |
f8 / float64 |
β / β | Converted to double in R. |
complex |
β / β | |
timedelta |
β / β | |
datetime |
β / β | |
string |
β / β | Converted to character in R. |
Unicode |
β / β | Converted to character in R. |
void * |
β / β | |
Structured data types | β / β | |
Object data type - VLenUTF8 | β / β | Converted to character in R. |
Note: no effort is made to assess loss of precision due to conversion.
Data Type | Status (reading / writing) |
Notes |
---|---|---|
zlib / gzip |
β / β | Only system default compression level 6 is enabled for writing. |
bzip2 |
β / β | Only system default compression level 6 is enabled for writing. |
blosc |
β / β | Only system default compression level 5 is enabled for writing. |
LZMA |
β / β | Only system default compression level 9 is enabled for writing. |
LZ4 |
β / β | |
Zstd |
β / β |
setwd("path/to/pizzarr")
install.packages("devtools")
devtools::install()
devtools::load_all()
devtools::check()
devtools::test()
install.packages("devtools")
install.packages("pkgdown")
devtools::document()
pkgdown::build_site()
- Discussion of Zarr in R
- Rarr
- Note:
pizzarr
has an optional dependency on Rarr for Blosc (de)compression.
- Note:
- R package development
- Zarr implementation