简体   繁体   中英

Error in library(ggplot2) : there is no package called ‘ggplot2’ Execution halted

I updated my system from ubuntu 18.04 to 18.10. everything worked fine on my previous version, but updating removed all my R libraries.

I want to reinstall them, but when I try and install anything, ie

install.packages("data.table")
Installing package into ‘/home/sam/R/x86_64-pc-linux-gnu-library/3.5’
(as ‘lib’ is unspecified)
trying URL 'http://cran.revolutionanalytics.com/src/contrib/data.table_1.11.8.tar.gz'
Content type 'application/octet-stream' length 3262853 bytes (3.1 MB)
==================================================
downloaded 3.1 MB

Error in library(ggplot2) : there is no package called ‘ggplot2’
Execution halted

The downloaded source packages are in
    ‘/tmp/RtmpYnxoaQ/downloaded_packages’
Warning message:
In install.packages("data.table") :
  installation of package ‘data.table’ had non-zero exit status

I get some error about ggplot2 not being present, even though i'm not trying to install it. Currently I haven't managed to isntall any libraries.

I am using R version 3.5.1 (2018-07-02) -- "Feather Spray" . which is the most recent version.

Any idea why this is happening?

I updated my system from ubuntu 18.04 to 18.10. everything worked fine on my previous version, but updating removed all my R libraries.

I want to reinstall them, but when I try and install anything, ie

install.packages("data.table")
Installing package into ‘/home/sam/R/x86_64-pc-linux-gnu-library/3.5’
(as ‘lib’ is unspecified)
trying URL 'http://cran.revolutionanalytics.com/src/contrib/data.table_1.11.8.tar.gz'
Content type 'application/octet-stream' length 3262853 bytes (3.1 MB)
==================================================
downloaded 3.1 MB

Error in library(ggplot2) : there is no package called ‘ggplot2’
Execution halted

The downloaded source packages are in
    ‘/tmp/RtmpYnxoaQ/downloaded_packages’
Warning message:
In install.packages("data.table") :
  installation of package ‘data.table’ had non-zero exit status

I get some error about ggplot2 not being present, even though i'm not trying to install it. Currently I haven't managed to isntall any libraries.

I am using R version 3.5.1 (2018-07-02) -- "Feather Spray" . which is the most recent version.

Any idea why this is happening?

@Roland was correct - the issue here was that I was trying to load libraries from my .Rprofile that weren't installed. Removing these lines from the .Rprofile stopped the error message.

I did two things and it's work. Hopefully, it does for you also

  1. a) Update your R and do this. Tool > Global Options > R version (CHANGE) > Select "Use your machine's default version of R..." b) Restart your app after.

  2. Install your ggplot2 using this command:

    install.packages("ggplot2", dependencies = TRUE) library(ggplot2)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM