Trouble with installing packages

I have been trying to fix this for the past week. I cannot seem to be able to install ggplot 2 package.

This is the message I get:

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

install.packages("ggplot2")
Installing package into ‘C:/Users/sarac/Documents/R/win-library/3.3’
(as ‘lib’ is unspecified)
Warning in install.packages :
dependencies ‘glue’, ‘rlang’, ‘lifecycle’, ‘magrittr’, ‘cli’ are not available
also installing the dependencies ‘pillar’, ‘vctrs’, ‘scales’, ‘tibble’

Warning in install.packages :
unable to access index for repository http://cran.rstudio.com/bin/windows/contrib/3.3:
cannot open URL 'http://cran.rstudio.com/bin/windows/contrib/3.3/PACKAGES'
Packages which are only available in source form, and may need compilation of C/C++/Fortran: ‘vctrs’ ‘tibble’
Do you want to attempt to install these from sources?
y/n: y
installing the source packages ‘pillar’, ‘vctrs’, ‘scales’, ‘tibble’, ‘ggplot2’

I have tried unticking the option in Tools> Global Options> Packages> Use secure download method for HTTP
Still did not work.

I have also tried to change the Primary CRAN repository from Global to one in the UK (which is where I am currently at).

I have tried to install the file manually from a zip file but when I tried to load it would say the file was not valid.

Please help me.

Is your internet connection behind a firewall or proxy server? This is usually the case when you are at work or school.

Also, you are using a very old R version, that can cause installation problems since some packages (including package dependencies) might not support such an old version. I would strongly recommend updating your R version if possible.

I tried using an older version to see if would fix it but I get the same error message with later versions.

Nope, I'm using my own wifi connection.

Ok, let's try to gather some more information about your problem, Could you update R to the latest stable release (4.2.1) and post the complete console output you get when you try to install ggplot2?

> install.packages("ggplot2")
WARNING: Rtools is required to build R packages but no version of Rtools compatible with the currently running version of R was found. Note that the following incompatible version(s) of Rtools were found:

 > Rtools 3.5 (installed at C:\Rtools)

> Please download and install the appropriate version of Rtools before proceeding:

> https://cran.rstudio.com/bin/windows/Rtools/
> Installing package into ‘C:/Users/sarac/AppData/Local/R/win-library/4.2’
(as ‘lib’ is unspecified)
also installing the dependencies ‘colorspace’, ‘cli’, ‘utf8’, ‘farver’, ‘labeling’, ‘lifecycle’, ‘munsell’, ‘R6’, ‘RColorBrewer’, ‘viridisLite’, ‘fansi’, ‘magrittr’, ‘pillar’, ‘pkgconfig’, ‘vctrs’, ‘digest’, ‘glue’, ‘gtable’, ‘isoband’, ‘rlang’, ‘scales’, ‘tibble’, ‘withr’


  There is a binary version available but the source version is later:
      binary source needs_compilation
vctrs  0.4.1  0.4.2              TRUE

>  Binaries will be installed
> trying URL 'http://cran.rstudio.com/bin/windows/contrib/4.2/colorspace_2.0-3.zip'
Content type 'application/zip' length 2630748 bytes (2.5 MB)
downloaded 2.5 MB

> trying URL 'http://cran.rstudio.com/bin/windows/contrib/4.2/cli_3.4.1.zip'
Content type 'application/zip' length 1255891 bytes (1.2 MB)
downloaded 1.2 MB

> trying URL 'http://cran.rstudio.com/bin/windows/contrib/4.2/utf8_1.2.2.zip'
Content type 'application/zip' length 150020 bytes (146 KB)
downloaded 146 KB

> trying URL 'http://cran.rstudio.com/bin/windows/contrib/4.2/farver_2.1.1.zip'
Content type 'application/zip' length 1512678 bytes (1.4 MB)
downloaded 1.4 MB

> trying URL 'http://cran.rstudio.com/bin/windows/contrib/4.2/labeling_0.4.2.zip'
Content type 'application/zip' length 62511 bytes (61 KB)
downloaded 61 KB

> trying URL 'http://cran.rstudio.com/bin/windows/contrib/4.2/lifecycle_1.0.2.zip'
Content type 'application/zip' length 123975 bytes (121 KB)
downloaded 121 KB

> trying URL 'http://cran.rstudio.com/bin/windows/contrib/4.2/munsell_0.5.0.zip'
Content type 'application/zip' length 244779 bytes (239 KB)
downloaded 239 KB

> trying URL 'http://cran.rstudio.com/bin/windows/contrib/4.2/R6_2.5.1.zip'
Content type 'application/zip' length 84265 bytes (82 KB)
downloaded 82 KB

> trying URL 'http://cran.rstudio.com/bin/windows/contrib/4.2/RColorBrewer_1.1-3.zip'
Content type 'application/zip' length 55837 bytes (54 KB)
downloaded 54 KB

> trying URL 'http://cran.rstudio.com/bin/windows/contrib/4.2/viridisLite_0.4.1.zip'
Content type 'application/zip' length 1300050 bytes (1.2 MB)
downloaded 1.2 MB

> trying URL 'http://cran.rstudio.com/bin/windows/contrib/4.2/fansi_1.0.3.zip'
Content type 'application/zip' length 312926 bytes (305 KB)
downloaded 305 KB

? trying URL 'http://cran.rstudio.com/bin/windows/contrib/4.2/magrittr_2.0.3.zip'
Content type 'application/zip' length 227233 bytes (221 KB)
downloaded 221 KB

> trying URL 'http://cran.rstudio.com/bin/windows/contrib/4.2/pillar_1.8.1.zip'
Content type 'application/zip' length 690299 bytes (674 KB)
downloaded 674 KB

> trying URL 'http://cran.rstudio.com/bin/windows/contrib/4.2/pkgconfig_2.0.3.zip'
Content type 'application/zip' length 22543 bytes (22 KB)
downloaded 22 KB

> trying URL 'http://cran.rstudio.com/bin/windows/contrib/4.2/vctrs_0.4.1.zip'
Content type 'application/zip' length 1298450 bytes (1.2 MB)
downloaded 1.2 MB

> trying URL 'http://cran.rstudio.com/bin/windows/contrib/4.2/digest_0.6.29.zip'
Content type 'application/zip' length 194544 bytes (189 KB)
downloaded 189 KB

> trying URL 'http://cran.rstudio.com/bin/windows/contrib/4.2/glue_1.6.2.zip'
Content type 'application/zip' length 161942 bytes (158 KB)
downloaded 158 KB

> trying URL 'http://cran.rstudio.com/bin/windows/contrib/4.2/gtable_0.3.1.zip'
Content type 'application/zip' length 164303 bytes (160 KB)
downloaded 160 KB

> trying URL 'http://cran.rstudio.com/bin/windows/contrib/4.2/isoband_0.2.5.zip'
Content type 'application/zip' length 2179273 bytes (2.1 MB)
downloaded 2.1 MB

> trying URL 'http://cran.rstudio.com/bin/windows/contrib/4.2/rlang_1.0.6.zip'
Content type 'application/zip' length 1574793 bytes (1.5 MB)
downloaded 1.5 MB

> trying URL 'http://cran.rstudio.com/bin/windows/contrib/4.2/scales_1.2.1.zip'
Content type 'application/zip' length 614865 bytes (600 KB)
downloaded 600 KB

> trying URL 'http://cran.rstudio.com/bin/windows/contrib/4.2/tibble_3.1.8.zip'
Content type 'application/zip' length 733228 bytes (716 KB)
downloaded 716 KB

> trying URL 'http://cran.rstudio.com/bin/windows/contrib/4.2/withr_2.5.0.zip'
Content type 'application/zip' length 231532 bytes (226 KB)
downloaded 226 KB

> trying URL 'http://cran.rstudio.com/bin/windows/contrib/4.2/ggplot2_3.3.6.zip'
Content type 'application/zip' length 4124220 bytes (3.9 MB)
downloaded 3.9 MB

package ‘colorspace’ successfully unpacked and MD5 sums checked
package ‘cli’ successfully unpacked and MD5 sums checked
package ‘utf8’ successfully unpacked and MD5 sums checked
package ‘farver’ successfully unpacked and MD5 sums checked
package ‘labeling’ successfully unpacked and MD5 sums checked
package ‘lifecycle’ successfully unpacked and MD5 sums checked
package ‘munsell’ successfully unpacked and MD5 sums checked
package ‘R6’ successfully unpacked and MD5 sums checked
package ‘RColorBrewer’ successfully unpacked and MD5 sums checked
package ‘viridisLite’ successfully unpacked and MD5 sums checked
package ‘fansi’ successfully unpacked and MD5 sums checked
package ‘magrittr’ successfully unpacked and MD5 sums checked
package ‘pillar’ successfully unpacked and MD5 sums checked
package ‘pkgconfig’ successfully unpacked and MD5 sums checked
package ‘vctrs’ successfully unpacked and MD5 sums checked
package ‘digest’ successfully unpacked and MD5 sums checked
package ‘glue’ successfully unpacked and MD5 sums checked
package ‘gtable’ successfully unpacked and MD5 sums checked
package ‘isoband’ successfully unpacked and MD5 sums checked
package ‘rlang’ successfully unpacked and MD5 sums checked
package ‘scales’ successfully unpacked and MD5 sums checked
package ‘tibble’ successfully unpacked and MD5 sums checked
package ‘withr’ successfully unpacked and MD5 sums checked
package ‘ggplot2’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
	C:\Users\sarac\AppData\Local\Temp\Rtmpamojj8\downloaded_packages


I assume I also have to update RTools now?

Yes, R 4.2.1 uses RTools42

Other than that it seems you no longer have any issues.

Yes, it works perfectly now - thank you! Can't believe I just needed to update it!

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.