var.inq.nc | R Documentation |
Inquire about a NetCDF variable.
var.inq.nc(ncfile, variable)
ncfile |
Object of class |
variable |
Either the ID or the name of the variable to be inquired. |
This function returns information about a NetCDF variable, including its name, ID, type, number of dimensions, a vector of the dimension IDs, and the number of attributes.
A list of named components, some of which are only included for datasets in "netcdf4"
format (as reported by file.inq.nc
).
id |
Variable ID. |
name |
Variable name. |
type |
External NetCDF data type as one of the following labels: |
ndims |
Number of dimensions the variable was defined as using. |
dimids |
Vector of dimension IDs corresponding to the variable dimensions ( |
natts |
Number of variable attributes assigned to this variable. |
chunksizes |
( |
cache_bytes |
( |
cache_slots |
( |
cache_preemption |
( |
deflate |
( |
shuffle |
( |
big_endian |
( |
fletcher32 |
( |
szip_options |
( |
szip_bits |
( |
filter_id |
( |
filter_params |
( |
Pavel Michna, Milton Woods
https://www.unidata.ucar.edu/software/netcdf/
## Create a new NetCDF dataset and define two dimensions
file1 <- tempfile("var.inq_", fileext=".nc")
nc <- create.nc(file1)
dim.def.nc(nc, "station", 5)
dim.def.nc(nc, "time", unlim=TRUE)
## Create two variables, one as coordinate variable
var.def.nc(nc, "time", "NC_INT", "time")
var.def.nc(nc, "temperature", "NC_DOUBLE", c(0,1))
## Inquire about these variables
var.inq.nc(nc, 0)
var.inq.nc(nc, "temperature")
close.nc(nc)
unlink(file1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.