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
ncdfCF::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
Method 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.
Method print()
Summary of the group printed to the console.
Method 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.
Method 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.
Method set_name()
Change the name of the NC group. The new name must be valid and should not duplicate a sibling group.
Method unused()
Find NC variables that are not referenced by CF objects. For debugging purposes only.
Returns
List of NCVariable.
Method 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.
Method append()
Append an object to this group.
Method fullnames()
This method lists the fully qualified name of this group, optionally including names in subgroups.
Method 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.