An open API service indexing awesome lists of open source software.

https://github.com/doi-usgs/rnz

rnz R NetCDF Zarr
https://github.com/doi-usgs/rnz

Last synced: about 1 month ago
JSON representation

rnz R NetCDF Zarr

Awesome Lists containing this project

README

        

---
output: github_document
---

```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```

# `rnz` R NetCDF Zarr

# rnz

[![codecov](https://codecov.io/github/dblodgett-usgs/rnz/graph/badge.svg?token=8DZJ7RYIOJ)](https://codecov.io/github/dblodgett-usgs/rnz)

This is a work in progress package aiming to provide an RNetCDF-like set of functions that wrap the [`pizzarr`](https://github.com/keller-mark/pizzarr) package.

```{r demo}

z <- rnz::z_demo() # to use a directory store

# to use an http store
z <- "https://raw.githubusercontent.com/DOI-USGS/rnz/main/inst/extdata/bcsd.zarr/"

bcsd <- rnz::open_nz(z)

class(bcsd)

if(!is.null(bcsd)) {

rnz::inq_nz_source(bcsd) |> str()

rnz::inq_grp(bcsd) |> str() # only the root group supported

rnz::inq_dim(bcsd, 0) |> str()
rnz::inq_dim(bcsd, "latitude") |> str()

rnz::inq_var(bcsd, 0) |> str()
rnz::inq_var(bcsd, "latitude") |> str()

rnz::inq_att(bcsd, 0, 5) |> str()
rnz::inq_att(bcsd, "latitude", "units") |> str()

rnz::get_var(bcsd, 0) |> str()
rnz::get_var(bcsd, "latitude") |> str()

rnz::get_att(bcsd, 0, 5)
rnz::get_att(bcsd, "time", "units")

rnz::nzdump(bcsd)

}

```

```{r disclaimer, child="DISCLAIMER.md", eval=TRUE}

```

[
![CC0](https://i.creativecommons.org/p/zero/1.0/88x31.png)
](https://creativecommons.org/publicdomain/zero/1.0/)