Skip to content

The save() function and the principle of least surprise. #108

Description

@bokov

Instead of overriding the base::save() function, could you just give yours a new name like forester_save() or something like that?

Otherwise you break the user's ability to save R objects unrelated to forester.

If for some reason you must override save(), can you please alter your function to use a compatible syntax with base::save() by doing the following:

  • Have the third argument be named file instead of name.
  • Get rid of the fourth argument, path because name can be a bare file name, a full path, or a relative path and that's how all other save functions in R handle it.
  • Include ... at the end of the signature so you can collect any save() arguments that forester::save() doesn't use and pass them to base::save(). Or at least ignore them instead of erroring which is what currently happens if the user uses an argument supported by base::save() but not forester::save().

This is very easy to do, and I'll be happy to submit a PR if that's something you would approve. Please let me know.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions