Unable to install packages R 3.6

So I realize that similar questions seem to be asked quite frequently, but I'm new and having trouble doing anything with R because I can't install any packages. I have tried installing "forecasting" and "dplyr".
When installing "forecasting" I am told "Error in install.packages : cannot open file 'C:/Users/Gabrielle Klemt/Documents/R/win-library/3.6/file46dc11b43cc7/backports/DESCRIPTION': Permission denied"

When installing dplyr I get error message:

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

Installing package into ‘C:/Users/Gabrielle Klemt/Documents/R/win-library/3.6’
(as ‘lib’ is unspecified)
Warning in install.packages :
'lib = "C:/Users/Gabrielle Klemt/Documents/R/win-library/3.6"' is not writable
Error in install.packages : unable to install packages

What I have done so far:

  • I have Rtools35 downloaded on my computer in the same folder as RStudio, but it still says I need Rtools.
  • I have checked my permissions on "C:/Users/Gabrielle Klemt/Documents/R/win-library/3.6" and my permissions say I have writing permission.
  • I checked the CRAN mirror is the global (for Canada) and the packages are available from this mirror

I would really appreciate any help.

It doesn't matter where you download the installer as long as you successfully install Rtools in your system.

Well, you should check again because obviously there is an issue, but a quicker solution would be to run RStudio as administrator.

I ran RStudio as administrator and then ran install.packackages("dplyr") again, and I got the same error message:
Error in install.packages : cannot open file 'C:/Users/Gabrielle Klemt/Documents/R/win-library/3.6/file474c75312dbc/backports/DESCRIPTION': Permission denied

Some times empty spaces on the windows user name can cause this kind of issue, try installing to the system level library (as administrator) and see if it works.

install.packages("dplyr", lib = "C:\\Program Files\\R\\R-3.6.2\\library")

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.