CARVIEW |
Select Language
HTTP/2 200
server: GitHub.com
content-type: text/html; charset=utf-8
last-modified: Tue, 25 Feb 2025 01:07:43 GMT
access-control-allow-origin: *
etag: W/"67bd17df-29ca"
expires: Fri, 10 Oct 2025 05:51:23 GMT
cache-control: max-age=600
content-encoding: gzip
x-proxy-cache: MISS
x-github-request-id: 9E55:9370D:111922:146E3A:68E89C82
accept-ranges: bytes
age: 0
date: Fri, 10 Oct 2025 05:41:23 GMT
via: 1.1 varnish
x-served-by: cache-bom-vanm7210058-BOM
x-cache: MISS
x-cache-hits: 0
x-timer: S1760074884.642549,VS0,VE309
vary: Accept-Encoding
x-fastly-request-id: 0817cacbee99f5c2a20c18e19c23c648415afc44
content-length: 2806
Slice into Zarr Arrays in R • pizzarr
Skip to contents
Pizzarr is an R implementation for Zarr.
Getting Started
The pizzarr
package includes:
- Support for reading and writing Zarr Arrays and Groups
- Support for numeric, logical, and string Zarr data types
- Support for both R-like one-based slicing and Python-like zero-based slicing
- Familiar API based on zarr-python and zarr.js
- R-based and R6-based implementation for ease of maintenance
Installation
Installation requires R 4.0.0 or greater.
install.packages("devtools")
devtools::install_github("keller-mark/pizzarr")
Examples
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