I can't install package ggplot2

What can I do?

Error:
install.packages("ggplot2")
WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:
Warning in install.packages :
downloaded length 57344 != reported length 4129856
Warning in install.packages :
error 1 in extracting from zip file
Warning in install.packages :
cannot open compressed file 'colorspace/DESCRIPTION', probable reason 'No such file or directory'
Error in install.packages : cannot open the connection

I tried with Rtools too:

install.packages("Rtools")
WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:
RTools: Toolchains for building R and R packages from source on Windows
Installing package into ‘C:/Users/Usuario/Documents/R/win-library/4.1’
(as ‘lib’ is unspecified)
Warning in install.packages :
package ‘Rtools’ is not available for this version of R

A version of this package for your version of R might be available elsewhere,
see the ideas at

RTools is not an R package it is a separate software that you have to install in your system (not in R). Just follow the link from the error message.

https://cran.rstudio.com/bin/windows/Rtools/

This seems like a connectivity issue, R is not being able to download the package from the CRAN repository you have selected, these are some things to try.

  • Choose a different CRAN repository, RStudios repository is a good choice (http://cran.rstudio.com/) or you could choose one that is geographically closer to you.
  • Disable secure download setting.
  • Check if your internet connection has traffic restrictions of some kind, like a firewall, proxy server, etc. This is usually the case when you are at work or school.

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.