Library not founding ggplot2 package

Hi everyone, I am new in the community just starting with R.
I am trying to install the package ggplot2. So, my code is simply:

install.packages("ggplot2")
library("ggplot2")

The package is downloaded. But when I run library("ggplot2") it wrote this:

library("ggplot2")
Error in library("ggplot2") : aucun package nommé ‘ggplot2’ n'est trouvé
which means that no package with this name is founded.

Thank you for your help.

Did you get any errors while installing the package? Also, when you call library(), you don't need quotes around the package name.

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

I don't know if the installation was write.
Here what was written :
also installing the dependency ‘scales’

There are binary versions available but the source versions are later:
binary source needs_compilation
scales 1.1.0 1.1.1 FALSE
ggplot2 3.3.0 3.3.2 FALSE

installing the source packages ‘scales’, ‘ggplot2’

essai de l'URL 'https://cran.rstudio.com/src/contrib/scales_1.1.1.tar.gz'
Content type 'application/x-gzip' length 515201 bytes (503 KB)

downloaded 503 KB

essai de l'URL 'https://cran.rstudio.com/src/contrib/ggplot2_3.3.2.tar.gz'
Content type 'application/x-gzip' length 3054431 bytes (2.9 MB)

downloaded 2.9 MB

  • installing source package ‘scales’ ...
    ** package ‘scales’ correctement décompressé et sommes MD5 vérifiées
    ** R
    ** byte-compile and prepare package for lazy loading
    Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :
    namespace ‘rlang’ 0.3.0.1 is being loaded, but >= 0.4.0 is required
    ERROR: lazy loading failed for package ‘scales’
  • removing ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/scales’
    Warning in install.packages :
    installation of package ‘scales’ had non-zero exit status
    ERROR: dependency ‘scales’ is not available for package ‘ggplot2’
  • removing ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/ggplot2’
    Warning in install.packages :
    installation of package ‘ggplot2’ had non-zero exit status

The downloaded source packages are in
‘/private/var/folders/dt/b8z2y_y17g51hsh_q1hxhhm40000gn/T/RtmprnwMqQ/downloaded_packages’

This message indicates that ggplot2 did not install properly. It looks like you have an outdated version of rlang. Try install.packages("rlang") first and then attempt installing ggplot2.

Yessss perfect thank you some much !!