Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

run R as administrator

Tags:

r

rstudio

I was using my own laptop to install R and I found that it only has one library. Evne though this library is still read only, everytime when I use Rstudio: install.packages("abc"), I can see that the new packages are stored automatically into that read only library folder.

In my office's desktop, I "believe" I also have administrator role, as I can install and remove anything (by far). I download the latest version of R and I right click the R-3.4.1-win.exe, there is an item "run as administrator", then it is installed in my desktop. However, when I use R studio to install new packages as in my laptop, it always automatically create a personal folder to store the new packages. I don't know why. Is that a way to only have one folder for library? I also tried on the desktop in the plain R mode (without using Rstudio). When I want to install new packages, it always says

Warning in install.packages("devtools") :
  'lib = "C:/Program Files/R/R-3.4.1/library"' is not writable

And there is a window pops up to ask me "would you like to create a personal folder?" And if I say no, then

Error in install.packages("devtools") : unable to install packages.

Is there a ways to solve this problem? To just maintain one folder for library

like image 204
kim kevin Avatar asked Jul 26 '17 03:07

kim kevin


1 Answers

What version of Windows are you using? You should be able to right-click on the Rstudio.exe icon, click Properties, and select an option to always run Rstudio as administrator. Be sure you use that same icon whenever you want to open Rstudio.

like image 147
Jay Avatar answered Nov 17 '22 16:11

Jay