Skip to content

find a more elegant way to initialize well object #38

@ybukhman

Description

@ybukhman

R refuses to initialize a well object with empty @Loess and @nls slots. It requires them to be of "loess" and "nls" class respectively. The current work-around is to initialize them to empty lists with class attributes set to "loess" and "nls". This, however, causes an error when a well object is printed, which required another work-around in the "show" method. This is all clunky. Is there a better way to do it? Consider the following possibilities:

  1. Use inheritance to define a "well" superclass that does not have @Loess and @nls slots and sub-classes that do have them. A new well would initially be of class "well", then assigned to the appropriate sub-class when the right object is available to populate the @Loess and/or @nls slot.
  2. Can instead use a generic slot with class set to "ANY". However, this is less rigorous.

Is there another way that we are not thinking about? Investigate and implement the best solution.

The same may be needed for the @equation slot as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions