Let's enjoy our life

[R 패키지] User library vs System library 차이점 본문

Study

[R 패키지] User library vs System library 차이점

IT파스칼 2021. 12. 23. 14:14

 

By default, R use a system library where base packages are installed and a user library where packages are installed. 

It is all defined in .libPaths() which is used by default by lib arg in install.packages(see help file) The first element of .libPaths() is used as default path for installing package. All paths are used to look for a package when you load them with library() with first path priority.

On my system, which is windows too, I have the same as you : 

  • system library in the folder where R is installed 
  • a user library in the Documents folder of my user. 

you can see libPath help page here (or type ?.libPaths() in console) for how to tweek the default behaviour with environment variable.

Comments