ropensci / RNeXML

Implementing semantically rich NeXML I/O in R
https://docs.ropensci.org/RNeXML
Other
13 stars 9 forks source link

Adds constructors for all classes in the hierarchy #208

Closed hlapp closed 5 years ago

hlapp commented 5 years ago

This follows the initial example of using the New() convenience function and the nexml.tree() constructor function that wraps that, and expands it to all other classes in the nexml class hierarchy. These constructors are now also exported so that users of the package can program with them while being insulated from the exact inner workings of initializing and naming classes.

The only classes not receiving a constructor function are the ListOfXXX classes, which are simply glorified lists but not otherwise embedded in the hierarchy (they also don't inherit from Base).

Also adds documentation, specifically here for the toplevel class (nexml). (It turns out that once you start documenting R CMD check pulls you into a bottomless documentation pit, because now you can't even miss a single slot, accidentally or on purpose (internal use slots, anyone? 😞)

hlapp commented 5 years ago

Notes:

cboettig commented 5 years ago

This looks good to merge! Yeah, we can drop rootEdge here or in a separate PR if you prefer.