Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
パッケージをロードするが、エクスポートするすべてのものを「メイン名前空間」に配置しないようにするにはどうすればよいですか?
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
パッケージ内のエクスポートされた変数にアクセスするには、::で十分です。この構文を機能させるためにパッケージをロードする必要はありません。?":::"詳細セクションの最初の段落で指摘されているように、@ csgillespieによって提案されたトリプルコロンは、パッケージによってエクスポートされていない内部変数を検査することを目的としています。
::
?":::"