This class represents a netCDF group, the object that holds elements like dimensions and variables of a netCDF file.
Direct access to groups is usually not necessary. The principal objects of interest, CF data variables and axes, are accessible via CFGroup. Changing the properties of a netCDF group other than its name may very well invalidate the CF objects or even the netCDF file.
Super class
NCObject -> NCGroup
Public fields
parentParent group of this group, the owning
CFDatasetfor the root group.subgroupsList of child
NCGroupinstances of this group.NCvarsList of netCDF variables that are located in this group.
NCdimsList of netCDF dimensions that are located in this group.
NCudtsList of netCDF user-defined types that are located in this group.
Active bindings
friendlyClassName(read-only) A nice description of the class.
resource(read-only) The RNetCDF object to the underlying netCDF resource.
handle(read-only) Get the handle to the netCDF resource for the group
can_write(read-only) Is the resource writable?
nameSet or retrieve the name of the group. Note that the name is always relative to the location in the hierarchy that the group is in and it should thus not be qualified by backslashes. The name has to be a valid CF name. The name of the root group cannot be changed.
fullname(read-only) The fully qualified absolute path of the group.
root(read-only) Retrieve the root group.
CFSet or retrieve the CFGroup that is associated with this NC group.
Methods
Inherited methods
NCGroup$new()
Create a new instance of this class.
Usage
NCGroup$new(id, name, attributes = data.frame(), parent, resource)Arguments
idThe identifier of the group. If
NA, the new group will be created in the netCDF resource, unless argumentparent == NULL, i.e. the root group which already exists.nameThe name of the group.
attributesOptional, a
data.framewith group attributes.parentThe parent group of this group. If
NULLthen argumentresourcemust be a valid instance ofNCResource.resourceOptional. Reference to the NCResource instance that provides access to the netCDF resource.
NCGroup$find_by_name()
Find an object by its name. Given the name of an object, possibly preceded by an absolute or relative group path, return the object to the caller. Usually this method is called programmatically.
NCGroup$find_dimvar_by_name()
Find a dimension variable by its name. Dimensions are scoped differently than other out-of-group objects - specifically, dimensions are visible in all child groups. Given the name of a dimension variable, possibly preceded by an absolute or relative group path, return the dimension variable to the caller. Usually this method is called programmatically.
NCGroup$find_dim_by_id()
Find an NC dimension object by its id. Given the id of a dimension, return the NCDimension object to the caller. The dimension has to be found in the current group or any of its parents.
Returns
The NCDimension object with an identifier equal to the id
argument. If the object is not found, returns NULL.
NCGroup$set_name()
Change the name of the NC group. The new name must be valid and should not duplicate a sibling group.
NCGroup$unused()
Find NC variables that are not referenced by CF objects. For debugging purposes only.
Returns
List of NCVariable.
NCGroup$create_group()
Create a new group as a sub-group of the current group. This writes the new group to the netCDF resource, but only if it is open for writing.
Arguments
CFgroupThe CFGroup associated with this NC group.
NCGroup$append()
Append an object to this group.
NCGroup$fullnames()
This method lists the fully qualified name of this group, optionally including names in subgroups.
NCGroup$dimensions()
List all the dimensions that are visible from this group, possibly including those that are defined in parent groups (by names not defined by any of their child groups in direct lineage to the current group).
Arguments
scopeCharacter string that indicates if only dimensions in the current group should be reported (
local) or visible dimensions in parent groups as well (all, default).
Returns
A vector of NCDimension objects.