简体   繁体   中英

I am unable to install packages in R

When I try to install any package in Rstudio I get the following error message:

Error in install.packages : path[1]="C:\Users\javad\Documents\.Rhistory\win-library\3.2": The system cannot find the path specified

How can I solve it?

Remove the file .Rhistory in directory C:\\Users\\javad\\Documents\\.Rhistory

Now try installing the package. This should solve your problem.

You need to set your library path to a folder that exists.

At the shell prompt type:

   export R_LIBS="C:/users/your_username/R_libs"
   mkdir C:/users/your_username/R_libs

Changing R default library path using .libPaths in Rprofile.site fails to work

https://www.stat.osu.edu/computer-support/mathstatistics-packages/installing-r-libraries-locally-your-home-directory

In my case antivirus which was stopping r studio to download and install. For that we can either add exception in antivirus for r studio or disable antivirus and install.

Last year I had no problems in installing TIDYVERSE with install.packages("tidyverse")

But now when I try to install the TIDYVERSE package in Rstudio I get hundreds of error messages like this one:

Warning in install.packages: installation of package 'googledrive' had non-zero exit status ERROR: dependencies 'callr', 'knitr', 'lifecycle', 'rmarkdown' are not available for package 'reprex'

  • removing 'C:/Users/wgolik/Documents/R/win-library/3.6/reprex' Warning in install.packages: installation of package 'reprex' had non-zero exit status ERROR: dependency 'ggplot2' is not available for package 'broom'
  • removing 'C:/Users/wgolik/Documents/R/win-library/3.6/broom'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM