Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

dim.inq.nc

Inquire About a NetCDF Dimension


Description

Inquire about a NetCDF dimension.

Usage

dim.inq.nc(ncfile, dimension)

Arguments

ncfile

Object of class "NetCDF" which points to the NetCDF dataset (as returned from open.nc).

dimension

Either the ID or the name of the dimension to be inquired.

Details

This function returns information about a NetCDF dimension. Information about a dimension include its name, its ID, its length and a flag if it is the unlimited dimension of this NetCDF dataset, if any. The length of the unlimited dimension, if any, is the number of records written so far.

Value

A list containing the following components:

id

Dimension ID.

name

Dimension name.

length

Length of dimension. For the unlimited dimension, this is the number of records written so far.

unlim

TRUE if it is the unlimited dimension, FALSE otherwise.

Author(s)

Pavel Michna, Milton Woods

References

Examples

##  Create a new NetCDF dataset and define two dimensions
file1 <- tempfile("dim.inq_", fileext=".nc")
nc <- create.nc(file1)

dim.def.nc(nc, "station", 5)
dim.def.nc(nc, "time", unlim=TRUE)

##  Inquire about the dimensions
dim.inq.nc(nc, 0)
dim.inq.nc(nc, "time")

close.nc(nc)
unlink(file1)

RNetCDF

Interface to 'NetCDF' Datasets

v2.4-2
GPL (>= 2) | file LICENSE
Authors
Pavel Michna [aut], Milton Woods [aut, cre]
Initial release
2020-09-12

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.