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.
Instead of overriding the
base::save()function, could you just give yours a new name likeforester_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 withbase::save()by doing the following:fileinstead ofname.pathbecausenamecan be a bare file name, a full path, or a relative path and that's how all other save functions in R handle it....at the end of the signature so you can collect anysave()arguments thatforester::save()doesn't use and pass them tobase::save(). Or at least ignore them instead of erroring which is what currently happens if the user uses an argument supported bybase::save()but notforester::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.