Skip to contents

NOTE: assumes the `_ARRAY_DIMENSION` convention from `xarray`

Usage

inq_dim(z, dim)

# S3 method for character
inq_dim(z, dim)

# S3 method for NetCDF
inq_dim(z, dim)

# S3 method for ZarrGroup
inq_dim(z, dim)

# S3 method for `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
#>