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

Jack Pincus j@ck@p|ncu@ @end|ng |rom @bcg|ob@|@net
Thu Jul 26 17:15:55 CEST 2018


Thanks to everyone for their answers.  The problem is indeed a Windows problem.  The default setting for document storage in Windows 10 is OneDrive which is Microsoft's cloud storage service.  This seems to be new for Windows 10. (I didn't have this problem running R under Windows 8.1 which introduced OneDrive.)  R for Windows apparently chooses the default document storage folder when setting up a personal library.  Disabling OneDrive for autosaving documents in OneDrive settings solved the problem.
Jack 

    On Thursday, July 26, 2018 7:03 AM, Leslie Rutkowski <leslie.rutkowski using gmail.com> wrote:
 

 I've run into this problem on nearly every new machine I've touched in the
past year. Here is a solution that has consistently worked for me in
Windows 7 &  10:

1.      Use .libPaths() to find where packages are being stored.

2.      To change this path: Control Panel > search “View advanced system
settings” > Environment Variables *button *>

a.      *Edit* current R_LIBS_USER to new file path (you might have to
create this - I did just yesterday)

b.      *New* R_LIBS_USER with desired file path

3.      Restart machine.


On Thu, Jul 26, 2018 at 12:35 PM Henrik Bengtsson <
henrik.bengtsson using gmail.com> wrote:

> 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.
>
> ______________________________________________
> 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.

   
	[[alternative HTML version deleted]]




More information about the R-help mailing list