When I load my package into the global environment, I get the following message
> library(saber) Attaching package: ‘saber’ The following objects are masked _by_ ‘.GlobalEnv’: load.schedule, teamStats
I don't know what that means, nor whether I should be concerned about it.
Why is this message being delivered, and what does it mean?
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,
saber::teamStats
.Probably (2) is best, unless the circumstances that led to the message are truly unusual.
There's a third implied question that I don't think has been fully answered for this particular case. How to fix it in the situation where an earlier version of your own function is stuck in the global environment and masking new versions you're trying to test?
Renaming your function with every rev is not practical in this situation. I had the same situation and found deleting the .Rdata file in the working directory before restarting R solved the problem.
This has happened to me only twice over hundreds of time assembling my packages. I'm still not sure how the functions are occasionally getting stuck in global.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With