When I open sudo R
into the terminal and try, for instance, install "ggplot2", the terminal/rstudio returns with this message.
installing to /home/gui/R/x86_64-pc-linux-gnu-library/3.5/mgcv/libs
** R
** data
** inst
** byte-compile and prepare package for lazy loading
Error: package or namespace load failed for ‘nlme’:
package ‘nlme’ was installed by an R version with different internals; it needs to be reinstalled for use with this R version
Error : package ‘nlme’ could not be loaded
ERROR: lazy loading failed for package ‘mgcv’
* removing ‘/home/gui/R/x86_64-pc-linux-gnu-library/3.5/mgcv’
ERROR: dependency ‘mgcv’ is not available for package ‘ggplot2’
* removing ‘/home/gui/R/x86_64-pc-linux-gnu-library/3.5/ggplot2’
The downloaded source packages are in
‘/tmp/RtmpRyAmBn/downloaded_packages’
Warning messages:
1: In install.packages("ggplot2") :
installation of package ‘mgcv’ had non-zero exit status
2: In install.packages("ggplot2") :
installation of package ‘ggplot2’ had non-zero exit status
And when I put library("ggplot2") the output:
library("ggplot2") Error in library("ggplot2") : there is no package called ‘ggplot2’