I have a package ncdfCF
(dev version from devtools::install_github("pvanlaake/ncdfCF")
) which consists of a collection of S4 classes to read NetCDF files. Top-level classes (e.g. ncdfGroup
) have lists of more specialist classes. The objects in the class hierarchy necessarily refer back to the parent class, through a slot of a common virtual S4 class type. Everything works just fine.
When I open an uncomplicated NetCDF file with 1 variable and 4 dimensions I can see the description in the environment pane in the IDE. For every lower-level object I see the parent information repeated, with about 600 lines omitted at the bottom. Clutter, a tad annoying, but bearable.
When I open a NetCDF file with a somewhat more complex hierarchy (3 levels of ncdfGroup
, multiple ncdfVariable
and ncdfDimension
objects) the description of the object in the environment pane just explodes. A bog-standard MODIS L3m file is read into a ncdfDataset
object (metadata only) and lobster::obj_size()
reports 164.49kB. In the environment pane the description takes up 23.7MB (almost as large as the entire file!), with "6778 lines omitted". This obviously all goes into describing parent objects, whose description includes the child objects, whose description includes...
Opening a few MODIS files in an interactive session will thus eat my RAM and make my environment pane less than useful. Is there a way to avoid this circular description? Could this be a feature request?