![]() One problem with this scheme is that if a local library invokes the library() function, it won't know to also search the local library Changing the library path for a session To access it, the lib.loc= argument of library must be used: library('caTools',lib='~/MyRlibs') Will install the specified package in your local directory. The command: install.packages('caTools',lib='~/MyRlibs') Suppose there is a directory called MyRlibs in your home directory. You can modify R's notion of your library path on a one-time basis by specifying the lib= argument to install.packages. If you need more control over the library path, R provides a number of methods for controlling the library path to accommodate just about any user's need. libPaths() to check that the user-level directory is the default location (it should be the first result printed, as seen below) where R will install packages. The simplest solution is to create the directory: mkdir -p ~/R/x86_64-pc-linux-gnu/4.2 Mkdir: cannot create directory '/server/linux/lib/R/site-library/00LOCK': Permission denied ERROR: failed to lock directory '/server/linux/lib/R/site-library' for modifying However, if that directory does not exist, you may get an error message like this: ![]() So if you need a package quickly or on a one-time basis, or if the package is particularly specialized, you might install it locally.īy default, user-installed packages are installed in the `R` subdirectory in your home directory, in ~/R/x86_64-pc-linux-gnu-library/4.2. However, you can also install packages locally within your home directory. ![]() ![]()
0 Comments
Leave a Reply. |