Cannot install "ggplot2" on R studio version 4.0.3 :(

Hi all !

For some reason I cannot install ggplot2 on my R studio (Version 4.0.3)

I installed Rtools 4 and restarted R and I input the following command :

write('PATH="{RTOOLS40_HOME}\\usr\\bin;{PATH}"', file = "~/.Renviron", append = TRUE)

Then I restarted R and I checked if the path was good :


I then tried to install ggplot2 like this :

install.packages("ggplot2", type="source")

And it did not work when I tried to load it it says that there is no package
So i tried again like this :

and got the following errors :

Installing package into ‘C:/Users/milan/Documents/R/win-library/4.0’
(as ‘lib’ is unspecified)

There is a binary version available but the source version
is later:
binary source needs_compilation
ggplot2 3.3.5 3.4.2 FALSE

installing the source package ‘ggplot2’

trying URL ''
Content type 'application/x-gzip' length 3153811 bytes (3.0 MB)
downloaded 3.0 MB

  • installing source package 'ggplot2' ...
    ** package 'ggplot2' successfully unpacked and MD5 sums checked
    ** using staged installation
    ** R
    ** data
    *** moving datasets to lazyload DB
    ** inst
    ** byte-compile and prepare package for lazy loading
    Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
    namespace 'pillar' 1.4.7 is being loaded, but >= 1.6.2 is required
    Calls: ... namespaceImportFrom -> asNamespace -> loadNamespace
    Execution halted
    ERROR: lazy loading failed for package 'ggplot2'
  • removing 'C:/Users/milan/Documents/R/win-library/4.0/ggplot2'
    Warning in install.packages :
    installation of package ‘ggplot2’ had non-zero exit status

The downloaded source packages are in

And it still does not find the package ggplot2, I am starting to be a bit desperate does anybody knows what is wrong?

This is the relevant part of the error message.
first; install a more recent version of pillar package, and then try again with ggplot2

It worked ! Thankyou so much !

This topic was automatically closed 42 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.