facing some problems installing ggplot2

Hi, I am a beginner here. I've recently studied R and I need to download the mpg dataset which is available in ggplot2 in order to do my assignment but i just can't install the package :nauseated_face:. I've found some ways to solve the issues in here but it turned out the same that I can't install it. Please help meT___T

here's my errors ( actually, there are a lot more than these but I just don't understand a thing)
Warning in install.packages :
installation of package ‘Matrix’ had non-zero exit status

  • installing source package ‘lifecycle’ ...
    ** package ‘lifecycle’ successfully unpacked and MD5 sums checked
    ** using staged installation
    ** R
    ** inst
    ** byte-compile and prepare package for lazy loading
    Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :
    namespace ‘rlang’ 0.3.4 is being loaded, but >= 0.4.0 is required
    Calls: ... withCallingHandlers -> loadNamespace -> namespaceImport -> loadNamespace
    Execution halted
    ERROR: lazy loading failed for package ‘lifecycle’
  • removing ‘/opt/anaconda3/lib/R/library/lifecycle’
    Warning in install.packages :
    installation of package ‘lifecycle’ had non-zero exit status
    ERROR: dependency ‘colorspace’ is not available for package ‘munsell’
  • removing ‘/opt/anaconda3/lib/R/library/munsell’
    Warning in install.packages :
    installation of package ‘munsell’ had non-zero exit status
    ERROR: dependency ‘processx’ is not available for package ‘callr’
  • removing ‘/opt/anaconda3/lib/R/library/callr’
    Warning in install.packages :
    installation of package ‘callr’ had non-zero exit status
    ERROR: dependencies ‘nlme’, ‘Matrix’ are not available for package ‘mgcv’
  • removing ‘/opt/anaconda3/lib/R/library/mgcv’
    Warning in install.packages :
    installation of package ‘mgcv’ had non-zero exit status
    ERROR: dependencies ‘farver’, ‘lifecycle’, ‘munsell’ are not available for package ‘scales’
  • removing ‘/opt/anaconda3/lib/R/library/scales’
    Warning in install.packages :
    installation of package ‘scales’ had non-zero exit status
    ERROR: dependency ‘callr’ is not available for package ‘pkgbuild’
  • removing ‘/opt/anaconda3/lib/R/library/pkgbuild’
    Warning in install.packages :
    installation of package ‘pkgbuild’ had non-zero exit status
    ERROR: dependency ‘pkgbuild’ is not available for package ‘pkgload’
  • removing ‘/opt/anaconda3/lib/R/library/pkgload’
    Warning in install.packages :
    installation of package ‘pkgload’ had non-zero exit status
    ERROR: dependency ‘pkgload’ is not available for package ‘testthat’
  • removing ‘/opt/anaconda3/lib/R/library/testthat’
    Warning in install.packages :
    installation of package ‘testthat’ had non-zero exit status
    ERROR: dependency ‘testthat’ is not available for package ‘isoband’
  • removing ‘/opt/anaconda3/lib/R/library/isoband’
    Warning in install.packages :
    installation of package ‘isoband’ had non-zero exit status
    ERROR: dependencies ‘isoband’, ‘MASS’, ‘mgcv’, ‘scales’ are not available for package ‘ggplot2’
  • removing ‘/opt/anaconda3/lib/R/library/ggplot2’
    Warning in install.packages :
    installation of package ‘ggplot2’ had non-zero exit status

The downloaded source packages are in
‘/private/var/folders/cl/rq1r7rn174b_wcgfgvh47x640000gn/T/RtmpDqW9k3/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done

I suspect you need to update your R or some key packages. Please post the first three lines that are returned by the command

sessionInfo()

When using Anaconda you are better off installing packages through the environment manager and not directly from CRAN.

Also, Anaconda is great for Python but not so much for R so if you are going to be working with R, I suggest you to change to a stand alone installation instead of relying on Anaconda

is it here? sorry for my late reply :sob:

also installing the dependencies ‘ps’, ‘processx’, ‘callr’, ‘pkgbuild’, ‘pkgload’, ‘rlang’, ‘lattice’, ‘colorspace’, ‘testthat’, ‘nlme’, ‘Matrix’, ‘farver’, ‘lifecycle’, ‘munsell’, ‘isoband’, ‘MASS’, ‘mgcv’, ‘scales’

trying URL 'https://cran.rstudio.com/src/contrib/ps_1.3.4.tar.gz'
Content type 'application/x-gzip' length 99047 bytes (96 KB)

downloaded 96 KB

Thank you so much, I have tried installing R Studio as you said but my macbook notified me that it is unable to locate. ( I don't know why) :sob: :sob: I will try it again!

I can finally download RStudio and install ggplot2 now, Thanks a lot! :star_struck: :star_struck:

I can install ggplot2 now, thank you for your kind help :heart_eyes_cat:

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.