type.inq.nc | R Documentation |
Inquire about a NetCDF builtin or user-defined data type.
type.inq.nc(ncfile, type, fields=TRUE)
ncfile |
Object of class |
type |
ID or name of a NetCDF data type. |
fields |
Read members of enum types or fields of compound types (default |
This function obtains information about a NetCDF data type, which could be builtin or user-defined. The items in the return list depend on the class of the NetCDF type.
A list containing the following components:
id |
Type ID. |
name |
Type name. |
class |
One of the keywords |
size |
Size in bytes of a single item of the type (or a single element of a |
basetype |
( |
If fields=TRUE
, the return list includes details about members of enum types or fields of compound types:
value |
( |
offset |
( |
subtype |
( |
dimsizes |
( |
Pavel Michna, Milton Woods
https://www.unidata.ucar.edu/software/netcdf/
grp.inq.nc
- get a list of NetCDF types defined in a dataset or group.
type.def.nc
- define a new NetCDF type.
## Create a new NetCDF4 dataset and define types
file1 <- tempfile("type.inq_", fileext=".nc")
nc <- create.nc(file1, format="netcdf4")
# Define a type of each class:
type.def.nc(nc, "blob", "opaque", size=128)
type.def.nc(nc, "vector", "vlen", basetype="NC_FLOAT")
type.def.nc(nc, "factor", "enum", basetype="NC_INT",
names=c("peanut butter", "jelly"),
values=c(101, 102))
type.def.nc(nc, "struct", "compound",
names=c("siteid", "height", "colour"),
subtypes=c("NC_INT", "NC_DOUBLE", "NC_SHORT"),
dimsizes=list(NULL, NULL, c(3)))
# Inquire about the types:
typeids <- grp.inq.nc(nc)$typeids
for (typeid in typeids) {
print(type.inq.nc(nc, typeid))
}
close.nc(nc)
unlink(file1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.