Search code examples
rpryr

object is masked by GlobalEnv error


I have installed package pryr in my R studio and now trying to import the same, using

library(pryr)

Getting the error as :

Attaching package: ‘pryr’

The following object is masked _by_ ‘.GlobalEnv’:

    f

What shall be done, so that I can import it.


Solution

  • You've successfully loaded pryr. Congratulations!

    The message is telling you that you have an object f in your global environment. There is also a function called f that is exported by pryr. If you try to use this function, you may end up referring to your own f instead, causing problems. To disambiguate, you can use pryr::f to refer to the f in pryr.