How can I load a package but not put everything that it exports into the “main namespace”?
library(myPackage) # exports myVar
myVar # This works, but I want it not to work
myPackage::myVar # This works, and I do want it to work
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
For accessing the exported variables in a package,
::is sufficient. You don’t need to load the package for this syntax to work. As?":::"points out in the first paragraph of the Details section, the triple colon suggested by @csgillespie is intended for inspecting internal variables not exported by a package.