Skip to contents

NOTE: for Zarr v2 stores, reads the `_ARRAY_DIMENSIONS` xarray attribute; for Zarr v3 / NZ-1.0 stores, reads `dimension_names` from `zarr.json` via `pizzarr::ZarrArray$get_dimension_names()`.

Usage

inq_dim(z, dim)

# S3 method for class 'character'
inq_dim(z, dim)

# S3 method for class 'NetCDF'
inq_dim(z, dim)

# S3 method for class 'ZarrGroup'
inq_dim(z, dim)

# S3 method for class '`NULL`'
inq_dim(z, dim)

Arguments

z

an open ZarrGroup as returned by open_nz

dim

integer zero-based index id of dimension of interest

Value

list similar to that returned by dim.inq.nc

Examples


z <- open_nz(z_demo())

inq_dim(z, 0)
#> $id
#> [1] 0
#> 
#> $name
#> [1] "latitude"
#> 
#> $length
#> [1] 33
#> 

inq_dim(z, "latitude")
#> $id
#> [1] 0
#> 
#> $name
#> [1] "latitude"
#> 
#> $length
#> [1] 33
#> 

# equivalent data in NetCDF
if(requireNamespace("RNetCDF", quietly = TRUE)) {
  nc <- z_demo(format = "netcdf")

  (inq_dim(nc, 0))
}
#> $id
#> [1] 0
#> 
#> $name
#> [1] "latitude"
#> 
#> $length
#> [1] 33
#> 
#> $unlim
#> [1] FALSE
#>