Learn R Programming

ncdfCF (version 0.2.1)

NCObject: NetCDF base object

Description

This class is a basic ancestor to all classes that represent netCDF objects, specifically groups, dimensions, variables and the user-defined types in a netCDF file. More useful classes use this class as ancestor.

Arguments

Public fields

id

Numeric identifier of the netCDF object.

name

The name of the netCDF object.

attributes

data.frame with the attributes of the netCDF object. Create a new netCDF object

This class should not be instantiated directly, create descendant objects instead.

Methods


Method new()

Usage

NCObject$new(id, name)

Arguments

id

Numeric identifier of the netCDF object.

name

Character string with the name of the netCDF object. Print the attributes of the netCDF object

This function prints the attributes of the netCDF object to the console. Through object linkages, this also applies to the CF data variables and axes, which each link to a netCDF object.


Method print_attributes()

Usage

NCObject$print_attributes(width = 50)

Arguments

width

The maximum width of each column in the data.frame when printed to the console. Attributes of a netCDF object

This method returns netCDF object attributes.


Method attribute()

Usage

NCObject$attribute(att, field = "value")

Arguments

att

Vector of attribute names whose values to return.

field

The field of the attributes to return values from. This must be "value" (default), "type" or "length".

Returns

If the field argument is "type' or "length", a vector named with the att values that were found in the attributes. If argument field is "value", a list with elements named with the att values, containing the attribute value(s), except when argument att names a single attribute, in which case that attribute value is returned as an atomic object. If no attribute is named with a value of argument att an empty list is returned, or an empty string if there was only one value in argument att.


Method clone()

The objects of this class are cloneable with this method.

Usage

NCObject$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Details

The fields in this class are common among all netCDF objects. In addition, this class manages the attributes for its implementing classes.