-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
think carefully before masking base functions #144
Comments
I think it is fine because they are properly set up as generics for S4 classes. |
ok |
While it is "fine" -- I do agree it is possibly unwise -- it is a little hairy given that we have defined additional arguments that are not SoilProfileCollections that slightly differ from the base function definitions... I did look into this somewhat when I had to sort out the S4 documentation for these things. Both split and union have several possible conflicts in base/other packages -- I am not sure whether you were getting at "can we" or "should we" -- the latter is more philosophical and relates to the naming issue #140 |
I'm more concerned with should. |
... which should be discussed in the other issue probably. Can you elaborate? I don't see an inherent issue other than that it generates a message on load. |
Possibly relevant: There are probably safer ways we can handle these masking -- and possibly ways to avoid the messages while retaining names -- if we are clever. |
Also, I was wrong to be so definitive in my first response. As you said, we should think carefully about this.
|
See the changes I needed to make for documentation / dispatch of We can put the documentation to the main Rd file where |
Thanks for working on this. Chalk this up to another major set of decisions: generic (possible overloaded) function names vs. something like |
I recently added Since the original |
Thanks for As for re-naming, I don't mind using the SPC suffix for most of these short function names: |
The Names in base like |
Side note: I wish This is relevant to the discussion because we can add an argument. The |
I'm fine either way, even though I periodically (ha! get it?) use
Good idea. This means that |
True, but a lot has changed since the original motivation / implementation of
There was no failure, rather the discussion on |
I think |
I am suggesting that I define This issue may not have even started if it weren't for the fact that we get messages every time we load the aqp package on its own. If we adhere to the rule I stated above where we do not ever re-define the generics of base methods, we will only see those messages when we have non-base packages with same names (e.g. dplyr). I can look into what I can do to avoid even those messages -- as they may be very similar to the |
Good points, and I agree with your suggestions. There will always be some noise at package load time, esp. with the popularity of incantations like |
I have not forgotten about The methods that can be dispatched via S4 for SoilProfileCollections are "safe" -- so In https://github.com/ncss-tech/aqp/tree/union I took a crack at resolving this and propose a new syntax. I propose we:
|
Tagging #168; moving some above commentary to draft PR |
I am not sure how commonly folks run into masking issues with aqp, but was closing some browser tabs and thought I would add a link to this discussion. Might be worth working up a brief aqp-specific tutorial describing ideas in this article as it pertains to common packages. In R 3.6.0+ we can use the https://developer.r-project.org/Blog/public/2019/03/19/managing-search-path-conflicts/index.html These are practical base R solutions to the "inevitability" of masking -- and highlight the difference between masking that is intentional (e.g. dplyr replaces union, setdiff etc with methods that work generically in place of base equivalents) versus unexpected (two packages that were not 'designed' to co-exist -- e.g. aqp and dplyr). It also highlights that by default the generics that are handled by S4 are not considered conflicts unless in strict mode. While there are packages that manage conflicts, as author says this behavior should be lightweight and part of base R. It would be great if, as he suggests, these things could be defined somehow in the package DESCRIPTION. |
Thanks for offering ideas and several possible solutions.
I like the idea of removing all arguments to
Yes please.
Yeah, I get that but the name isn't appealing to me. The logic is sound but I think that a more connotative name will help adoption.
I think that we should remove it.
Yes, thanks.
Good idea so as not to break things just yet. |
I want to add to this that the choice to mask |
Proposed changes in #203--coupled with removal of some of our older previously deprecated functions cough |
I'm thinking that it may be unwise to cause the following:
The text was updated successfully, but these errors were encountered: