ggplot2 download failed

Hi, I am struggling to install ggplot2 package. I have already installed 'tidyverse' and 'rlang'. I have changed the R preferences by unticking the 'only safe http download' and the same error pops up. Can someone please tell me what is wrong. I didn't find anything similar on the community so far. Here is the error:

also installing the dependencies ‘maps’, ‘rgeos’, ‘sf’

trying URL 'http://cran.rstudio.com/bin/macosx/contrib/4.0/maps_3.3.0.tgz'
Content type 'application/x-gzip' length 3687860 bytes (3.5 MB)
======================
downloaded 1.6 MB

Warning in install.packages :
  downloaded length 1655629 != reported length 3687860
Warning in install.packages :
  URL 'http://cran.rstudio.com/bin/macosx/contrib/4.0/maps_3.3.0.tgz': Timeout of 60 seconds was reached
Error in download.file(url, destfile, method, mode = "wb", ...) : 
  download from 'http://cran.rstudio.com/bin/macosx/contrib/4.0/maps_3.3.0.tgz' failed
Warning in install.packages :
  download of package ‘maps’ failed
trying URL 'http://cran.rstudio.com/bin/macosx/contrib/4.0/rgeos_0.5-5.tgz'
Content type 'application/x-gzip' length 8537441 bytes (8.1 MB)
==============
downloaded 2.3 MB

Warning in install.packages :
  downloaded length 2417877 != reported length 8537441
Warning in install.packages :
  URL 'http://cran.rstudio.com/bin/macosx/contrib/4.0/rgeos_0.5-5.tgz': Timeout of 60 seconds was reached
Error in download.file(url, destfile, method, mode = "wb", ...) : 
  download from 'http://cran.rstudio.com/bin/macosx/contrib/4.0/rgeos_0.5-5.tgz' failed
Warning in install.packages :
  download of package ‘rgeos’ failed
trying URL 'http://cran.rstudio.com/bin/macosx/contrib/4.0/sf_0.9-7.tgz'
Content type 'application/x-gzip' length 89143896 bytes (85.0 MB)
==
downloaded 3.7 MB

Warning in install.packages :
  downloaded length 3915795 != reported length 89143896
Warning in install.packages :
  URL 'http://cran.rstudio.com/bin/macosx/contrib/4.0/sf_0.9-7.tgz': Timeout of 60 seconds was reached
Error in download.file(url, destfile, method, mode = "wb", ...) : 
  download from 'http://cran.rstudio.com/bin/macosx/contrib/4.0/sf_0.9-7.tgz' failed
Warning in install.packages :
  download of package ‘sf’ failed
trying URL 'http://cran.rstudio.com/bin/macosx/contrib/4.0/ggplot2_3.3.3.tgz'
Content type 'application/x-gzip' length 4068756 bytes (3.9 MB)
==============================================
downloaded 3.6 MB

Warning in install.packages :
  downloaded length 3795536 != reported length 4068756
Warning in install.packages :
  URL 'http://cran.rstudio.com/bin/macosx/contrib/4.0/ggplot2_3.3.3.tgz': Timeout of 60 seconds was reached
Error in download.file(url, destfile, method, mode = "wb", ...) : 
  download from 'http://cran.rstudio.com/bin/macosx/contrib/4.0/ggplot2_3.3.3.tgz' failed
Warning in install.packages :
  download of package ‘ggplot2’ failed

I use Ubuntu so I am not much use for a Mac but if you have **tidyverse **installed, I believe it installs ggplot automatically.

Try this and see what happens:

library(tidyverse)

dat1  <-  data.frame(x = 1:20, y = 20:1)

ggplot(dat1, aes(x , y)) + geom_point()

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.