What is supposed to happen if a package is installed in multiple libraries? For example, in Debian/Ubuntu one can install debianized packages through apt-get, and then also install a more recent version of the same package straight from CRAN. When using library(), will the most recent package be loaded, or does it depend on the order of .libPaths()?
Share
As already stated by others,
.libPaths()search order matter which is why we set it such that local packages are searched first as the distro versions, especially with Debian stable or Ubuntu releases that are not updated, are more likely to be older.There is a comment to this effect in the file
/etc/R/Renvironsetting it:So a user-set value of
R_LIBS_SITEwould get precedence, else the value shown here is used.