[R] Unable to Change Library Paths in R 3.5.1 in Windows 10

Henrik Bengtsson henr|k@bengt@@on @end|ng |rom gm@||@com
Thu Jul 26 12:34:53 CEST 2018


Some more info:

1. The library folder have to exist; if not, then R will silently ignore it.

2. Try call your .libPaths(my_new_folder) setup in an interactive R
session.  Then, in the same session, look at .libPaths().  The first
element should be your new folder.  If not, make sure it exists, e.g.
file_test("-d", my_new_folder).

3. If (1)-(2) is correct, then it might be that you save your
.Rprofile in the wrong location (or as .Rprofile.txt which happens in
some Windows editors, e.g. Notepad - if so, save with quotation
marks).  You can verify you've saved it in the correct place by
file_test("-f", "~/.Rprofile").  To find the full location, do
normalizePath("~/.Rprofile").

4. If you saved .Rprofile in the correct place, it could be that there
is a missing newline on the last line.  If that is the case, then R
silently ignores that line.

You might find the startup package helpful (disclaimer: I'm the
author); For (4), you can run startup::check() and it'll tell you and
fix potential issues like this one, e.g.

> startup::check()
Backed up R startup file: ‘~/.Rprofile’ (29 bytes) ->
‘~/.Rprofile.bak.20180726-122923’ (29 bytes)
Warning message:
In check_rprofile_eof(all = all, fix = fix, backup = backup, debug = debug) :
  SYNTAX ISSUE FIXED: Added missing newline to the end of file
~/.Rprofile, which otherwise would cause R to silently ignore the file
in the startup process.
>

/Henrik

On Wed, Jul 25, 2018 at 11:58 PM Bert Gunter <bgunter.4567 using gmail.com> wrote:
>
> Pemissions settings on your target  directory (which is a Windows not an R
> issue)??
>
> -- Bert
>
>
>
> Bert Gunter
>
> "The trouble with having an open mind is that people keep coming along and
> sticking things into it."
> -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
>
> On Wed, Jul 25, 2018 at 1:17 PM, Jack Pincus <jack.pincus using sbcglobal.net>
> wrote:
>
> > I just installed R 3.5.1 on a new Windows 10 computer.  R tries to set a
> > personal library to C:/Users/jackp/OneDrive/Documents/R/win-lib/3.5.  I
> > want to store R packages on my local hard drive, not OneDrive.  I tried
> > placing the line of code:.libPaths(c(.libPaths(),
> > "C:/Users/jackp/Documents/R/win-lib/3.5")) at the top of Rprofile located
> > in C:/Program Files/R/R3.5.1/library/base?R but it does not recognize
> > libraries in my personal library.  Any suggestions how to fix this
> > problem.  Also, is there a reason that R tries to default to OneDrive in
> > Windows 10.  I also had a OneDrive folder in Windows 8.1 but could set R to
> > recognize a personal library on C:/Users/jackp/Documents.
> > Thanks in advance,
> > Jack
> >         [[alternative HTML version deleted]]
> >
> > ______________________________________________
> > R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide http://www.R-project.org/
> > posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
> >
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.




More information about the R-help mailing list