att.def.ncv {ncvar}R Documentation

Define NetCDF Attribute(s)

Description

Defines an attribute object containing one or more attributes.

Usage

att.def.ncv(name, value, xtype=NULL, attlist=NULL)

Arguments

name The name of the attribute.
value The attribute value. This can be either a single numeric value or a vector of numeric values, or a character string.
xtype One of the predefined NetCDF external data types (NC_BYTE, NC_CHAR, NC_SHORT, NC_INT, NC_FLOAT, NC_DOUBLE). If no type is provided, NC_CHAR, NC_INT, or NC_FLOAT is chosen depending on the type of value .
attlist A list of attributes in the format "name", value, "name", value, etc. The attribute's external type is determined from its value.

Details

This function defines a new attribute object. This function is normally not called by the user.

Value

Object or list of objects of class "att.ncv"

Author(s)

Juerg Schmidli

Examples

## Define some attributes

att1 <- att.def.ncv(attlist=list("long_name", "precipitation", "units",
    "mm d-1", "_FillValue", -998.9, "grid_mapping", "rotated_pole") )

att2 <- att.def.ncv("_FillValue", -998.9, xtype = "NC_DOUBLE")

att3 <- att.def.ncv(attlist=list("long_name", "precipitation", 
    "units", "mm d-1") )

## Add an attribute object to a list of attribute objects
att4 <- append(att3, list(att2))

print.ncv(att1)
print.ncv(att4)


[Package ncvar version 1.0-4 Index]