cannot open file

Error in install.packages : cannot open file '\': Invalid argument

Every time I try to install the ggplot2 package this error appears...Who can help me, please?

Hello and Welcome to the RStudio Community Forum!
To get help with this problem you will need to provide the Forum with more information: what R code did you run that gave this error message? Or, did you use the RStudio Packages>Install menu system? Were you trying to use a public CRAN mirror or a local/private one? You will also need to post the R output from running this command:


which will give a detailed report of your R setup and operating environment.

I`m using the RStudio Packages > Install menu
R version 3.6.1 (2019-07-05)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 17763)

Matrix products: default

[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C
[5] LC_TIME=English_United States.1252

attached base packages:
[1] stats graphics grDevices utils datasets methods base

loaded via a namespace (and not attached):
[1] compiler_3.6.1 tools_3.6.1

Hmmm, nothing strange in that sessionInfo() output.
Have you chosen a CRAN mirror in the RStudio>Tools>Global Options>Packages menu? Try changing it to another mirror (local to you) to see if that fixes the problem.
If not, try installing the tidyverse package which will include ggplot2 and several others which you will surely need later.
If there are limited read/write access permissions on your machine this may cause problems. Try running RStudio "as administrator" and re-trying the install.
Did you install R and RStudio into the default directories and on the default drive (C:)?


Yes I did everything but at the end there is the same error!!! Installing tidyverse I have the same error but I tried to install vegan and it worked...I don`t know what to do anymore...

Try rebooting and restarting RStudio.
Your original error looks like it involves the package stringi.
Try installing stringi first, then stringr, then tidyverse.
If all this doesn't work, I suggest uninstalling R and RStudio, and re-installing both (without changing any defaults).
Good luck.

Hi @giovy27!

The last error message that install.packages() prints is not always very helpful in determining the source of the problem, which is often several steps before that. If you're still having trouble, can you please post the full console output you get when you try to install ggplot2?

Please be sure to format the console output as code to keep the forum software from garbling it! :smile: Just select everything you pasted and click the little </> button at the top of the posting box.

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