Hi,
dplyr::collapse masks nlme::collapse, so I have to load dplyr after nlme in order for dplyr to work as expected.
Similarly, dplyr::select masks MASS::select, so I have to load dplyr after nlme in order for dplyr to work as expected.
I presume that the consequence of loading dplyr last is that the masked functions no longer work as expected (unless the dplyr function is a strict superset of the masked function. Given that I loaded the earlier-loaded packages (e.g. nlme and MASS) because I needed to use them, how do I use them with dplyr loaded subsequently?
Obviously, I can just call the masked functions as nlme::collapse or MASS::select, but what happens to calls to masked functions from the code within the earlier loaded package? Possibly more difficult, what about calls to masked function from other packages? For example mgcv depends on nlme, so if mgcv calls nlme::collapse and I wan to use dplyr, what should the load order be: nlme > mgcv > dplyr?
More generally, what are the potential problems when functions are masked? How do you deal with those problems? Are there any problems that can't be dealt with?
I expect this has already been dealt with somewhere. A pointer would be greatly appreciated.
Thanks
Ross