rickhelmus / patRoon

Workflow solutions for mass-spectrometry based non-target analysis.
https://rickhelmus.github.io/patRoon/
GNU General Public License v3.0
61 stars 18 forks source link

Naming of filter function #12

Open tsufz opened 4 years ago

tsufz commented 4 years ago

Hi Rick, I have another issue. I suggest to rename the filter function of patRoon. The naming interferes with the tidyverse filter function and causes errors, if not called explicitly.

Best, Tobias

rickhelmus commented 4 years ago

Hi Tobias,

Renaming filter() will be quite an involvement and to be honest not something I would like to do in the short term as it will break a lot of existing code and documentation. For now I suggest to prefix function calls with the right package if you want to use both dplyr and patRoon, e.g.

dplyr::filter(...)
patRoon::filter(...)

Interestingly, the filter() function was one of the reasons to start the conflicted R package from the tidyverse.

Anyway, re-naming filter() may be worthwhile, as it also masks the original base::filter() function and there doesn't seem to be a nice way to around it. The function with the new name could of course co-exist for a while with filter() to transition users. Suggestions for a new name are welcome ;-)

tsufz commented 4 years ago

Hi Rick, Well, I have no problem to consider, the easiest way would be to update the documentation so long for less experienced users. Just give a hint that there are conflicts and an explicit call is required if dplyr is also loaded. I use tidyverse for data wrangling and thus it is often used in my scripts. I will think about a name.

Best, Tobias

rickhelmus commented 4 years ago

Hi Tobias,

Good point, will mention it in the docs!