0

When I run sessionInfo() I get:

R version 3.2.0 (2015-04-16)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.9.5 (Mavericks)

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] stringr_1.0.0

loaded via a namespace (and not attached):
[1] magrittr_1.5  tools_3.2.0   stringi_0.4-1

This leads me to three questions: a) why are 3 packages loaded via a namespace, b) what does it mean for them to be "loaded via a namespace (and not attached)", and c) what consequences does this have?

histelheim
  • 4,938
  • 6
  • 33
  • 63
  • 1
    It usually means that they are used by one of the attached packages. – Rich Scriven Aug 04 '15 at 15:52
  • @RichardScriven: What consequences does this have? Can I use functions in these packages, or do I need to attach the packages first? – histelheim Aug 04 '15 at 15:53
  • http://stackoverflow.com/questions/14988722/in-r-what-does-loaded-via-a-namespace-and-not-attached-mean – Akhil Nair Aug 04 '15 at 15:54
  • Of course you can use them. If you don't want to attach the package, you can use `package::function` (in some cases `package:::function`) instead of `library(package); function` – Rich Scriven Aug 04 '15 at 15:55
  • 1
    If you load the lattice package and then try to use a grid function (upon which both lattice and ggplot2 packages depend), you will discover that the grid function may not be available until you actually load with `library(grid)`. The suggestion to use something like `grid:::func(.)` may or may not succeed. It fails if that function in turn calls another non-exported function. – IRTFM Aug 04 '15 at 16:43

0 Answers0