R/R_error [Eng.]

Rstudio Package install Onedrive Error

Cha-Nyong 2022. 10. 28. 15:57
 
Hello, 

 

You must be visited here with error of package install of Rstudio, because of Onedrive. 

 

 

 

Error in install.packages : unable to create ‘C:/Users/hd/OneDrive/?????????/R/win-library/4.1’

 You must be ever seen like above error message.

 

 

 

 
The reason of problem is Onedrive folder of Microsoft.

 

Then, how can we fix this error?

 

 

 

 

 

 

 

There are 4 fixing methods. 

 

 
1. Open the Rstudio Program with administration authority.
 
 
i) Search the Rstudio through left below window searching bar.

 

ii) Click with right button of mouse and open with administration aurhority mode.  

 

iii) Install packages what you want.

 

 
 
 
 
 
 
2. Designation the library path with default.

 

.libPath("path/to/library/path")

 

Use above command, you can set your library path with default.

 

Change "path/to/library/path" to directory where you want to install packages.

 

However, if you use this method, you should type this command

 

every time when you re-open Rstudio.

 

It's quit tiresome.

 

So, number 3 method is suggested to you.

 

It is also kind of default directory designating method,

 

but we can designate just one time and no more setting. 

 

 

 

 

 

 
3. Default setting in Window Browse Directory.  

 

i) Press the button of "Win+R" Key.

 

ii) Copy and Paste "rundll32 sysdm.cpl,EditEnvironmentVariables"

 

iii) Click "New" under "user variables" 

 

iv) Copy and Paste "R_LIBS_USER"

 

iiv) Choose Browse Directory where you want to install packages.

 

(eg, C:\Users\username\R\lib)

 

 

 

 

 
4. Final method;  Initialization hard drive.
 
 

Recently, i bought new labtop.

 

when i install basic programs, i installed firstly R and Rstudio,

 

and next install program was MS Office.

 

Without Onedrive folder, Rstudio library path directory set to appopriate folder.

 

This method is last option when you really hate this error.

 

 
 
 
 
Hope to solve this error without default set by updating in Microsoft and Rstudio.