Meaning of objects being masked by the global environment

It means that you have objects (functions, usually) present in your global environment with the same name as (exported) things in your package. Type search() to see the order in which R resolves names.

The solution is to either,

  1. don’t create objects with those names in your global environment
  2. rename the objects in your package to something that’s less likely to create a conflict, or rethink your decision to export them, or
  3. remember that you will always have to refer to those objects as saber::teamStats.

Probably (2) is best, unless the circumstances that led to the message are truly unusual.

Leave a Comment