Javad
Javad

Reputation: 99

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?

Upvotes: 1

Views: 32594

Answers (3)

user4886675
user4886675

Reputation: 19

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.

Upvotes: 1

rakesh
rakesh

Reputation: 51

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

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

Upvotes: 5

Hack-R
Hack-R

Reputation: 23216

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

Upvotes: 4

Related Questions