patRoon icon indicating copy to clipboard operation
patRoon copied to clipboard

Naming of filter function

Open tsufz opened this issue 4 years ago • 3 comments

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

tsufz avatar Jul 01 '20 13:07 tsufz

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 ;-)

rickhelmus avatar Jul 06 '20 09:07 rickhelmus

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

tsufz avatar Jul 14 '20 12:07 tsufz

Hi Tobias,

Good point, will mention it in the docs!

rickhelmus avatar Aug 04 '20 14:08 rickhelmus