1

When trying to load a package from a location on a server

library("plyr", lib.loc="\\teneraserver/users/jphelan/My Documents/R/win-library/3.0")

I get the following error

Error in library("plyr", lib.loc = "\\teneraserver/users/jphelan/My Documents/R/win-library/3.0") : 
    no library trees found in 'lib.loc'

I ran

.libPaths()

which returns

[1] "\\\\teneraserver/users/jphelan/My Documents/R/win-library/3.0"
[2] "C:/R/R-3.0.1/library"   

The package is in

.libpaths()[1]

I have read How do you change library location in R? as I'm happy to work on my C drive and avoid complications working through a server but am still unsure of what I'm doing. Do I have to completely uninstall and reinstall or can I just alter the location of my package library (permanently on my machine not at the start of every session)? I am running Windows 7 and R version 3.0.1. My editor is RStudio Version 0.97.551

Community
  • 1
  • 1
Joe_P
  • 45
  • 1
  • 5
  • 1
    What does `.libPaths()` return. And please post it in an edit to your question. – IRTFM Jul 09 '13 at 00:06
  • By checking .libPaths() and reading @Hong Ooi's response I got to the bottom of this. Thanks for your help DWin. – Joe_P Jul 09 '13 at 17:52

1 Answers1

2

You forgot to escape the starting double backslashes. Use \\\\teneraserver, not \\teneraserver. Alternatively, use forward slashes throughout: //teneraserver.

Actually, since your server path is already in .libPaths, you could just omit the lib.loc argument entirely.

Hong Ooi
  • 56,353
  • 13
  • 134
  • 187
  • Thanks Hong Ooi, that did it! In fact the code came from RStudio. It runs when I select the check marks beside the package name in the Load Packages window. I'll work with RStudio to get that to work, but for now I'll be writing the code instead of mouse clicking... – Joe_P Jul 09 '13 at 17:53