R - How to specify a path in normalizePath or get around this error associated with this?

I study R and just install it on my office computer. I do not have administrator privileges on the computer (since I even need to call IT for installation).

Then I install the package. At first, this does not work when typing, for example:

install.packages("thepackage")

Error message:

Error in normalizePath(path.expand(path), winslash, mustWork) : 
  path[1]="\\company\5050\Users\myusername\Documents\R\win-library\3.3": Access is denied
In addition: Warning message:
In normalizePath(path.expand(path), winslash, mustWork) :
  path[1]="\\company/5050/Users/myusername/Documents/R/win-library/3.3": Access is denied

I am doing some homework and I think the potential solution is "Map a network drive to a network folder." I'm not sure what this means, but I try this:

install.packages("thepackage",lib="H:/Documents/R/win-library/3.3")

because it looks like I have more “control” of drive H (it has my username on it). And it works:

package ‘thepackage’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
    C:\Users\myusername\AppData\Local\Temp\Rtmp4MNURu\downloaded_packages

Then I do not download the package,

library(thepackage)

saying:

Error in normalizePath(path.expand(path), winslash, mustWork) : 
  path[1]="\\company/5050/Users/myusername/Documents/R/win-library/3.3": Access is denied

But again this works:

library(thepackage,lib="H:/Documents/R/win-library/3.3")

, normalizePath , , ?

+6
3

.Rprofile ( , ) :

.libPaths("H:/Documents/R/win-library/3.3")

, . .Rprofile , R. , , .

+1

, :

system("net use D: \\\\company\\path\\")

D. file.path D:. , R defalut Rprofile.site, :

.libPaths("Path to your libs")

.libPaths() ?

0

you are the rescuer !!. Profile really works

0
source

All Articles