Cant install GGplot

Hi All,

I am having problem installing GGPLOT package. This is what happened when I tried to install them.

WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:

https://cran.rstudio.com/bin/windows/Rtools/
Installing package into ‘C:/Users/Profile1/Documents/R/win-library/3.6’
(as ‘lib’ is unspecified)
also installing the dependencies ‘rlang’, ‘scales’

There are binary versions available but the source versions are later:
binary source needs_compilation
rlang 0.4.11 1.0.4 TRUE
scales 1.1.1 1.2.1 FALSE
ggplot2 3.3.3 3.3.6 FALSE

Binaries will be installed
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.6/rlang_0.4.11.zip'
Content type 'application/zip' length 1224139 bytes (1.2 MB)
downloaded 1.2 MB

package ‘rlang’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
C:\ Users\Profile1\AppData\Local\Temp\Rtmpory2Y8\downloaded_packages
installing the source packages ‘scales’, ‘ggplot2’

trying URL 'hxxxps://cran.rstudio.com/src/contrib/scales_1.2.1.tar.gz'
Content type 'application/x-gzip' length 270609 bytes (264 KB)
downloaded 264 KB

trying URL 'hxxxs://cran.rstudio.com/src/contrib/ggplot2_3.3.6.tar.gz'
Content type 'application/x-gzip' length 3061989 bytes (2.9 MB)
downloaded 2.9 MB

  • installing source package 'scales' ...
    ** package 'scales' successfully unpacked and MD5 sums checked
    ** using staged installation
    ** R
    ** byte-compile and prepare package for lazy loading
    Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :
    namespace 'rlang' 0.4.11 is being loaded, but >= 1.0.0 is required
    Calls: ... withCallingHandlers -> loadNamespace -> namespaceImport -> loadNamespace
    Execution halted
    ERROR: lazy loading failed for package 'scales'
  • removing 'C:/Users/Profile1/Documents/R/win-library/3.6/scales'
    Warning in install.packages :
    installation of package ‘scales’ had non-zero exit status
    ERROR: dependency 'scales' is not available for package 'ggplot2'
  • removing 'C:/Users/Profile1/Documents/R/win-library/3.6/ggplot2'
    Warning in install.packages :
    installation of package ‘ggplot2’ had non-zero exit status

The downloaded source packages are in
‘C:\Users\Profile1\AppData\Local\Temp\Rtmpory2Y8\downloaded_packages’

Hi,
are you installing package by script or Rstudio package installer?
can you share me exactly how you are trying to install?

From script.

Install packages("ggplot2')

This is asking you to update rlang but the problem is that there is no binary available for your old R version and you haven't installed RTools in your system so you can't compile it from source.

To solve this you can either install a suitable RTools version for you or R version or update R so you can get access to precompiled binaries for the latest package versions.

I actually done both RStudio 2022.07.1 Build 554.

Install rtools42

RStudio is an IDE for the R programming language but it doesn't come with R bundled, you have to update it separately. You are currently using R 3.6 and RTools40 is for being used with R >4.0.0, the latest R version is 4.2.1 you can download it from here

https://cran.r-project.org/bin/windows/

Thanks! Got it working now.

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