Re: [Rd] Feature request: Change default library path on Windows

2021-07-25 Thread Jeroen Ooms
On Sun, Jul 25, 2021 at 12:15 AM Steve Haroz  wrote:
>
> Hello,
>
> I'd like to propose moving the default library install location on Windows 
> from:
> %USERPROFILE%/Documents/R
> to some other location such as:
> %USERPROFILE%/R
>
> For many users the Documents folder is backed up or synchronized.
> Installing libraries thrashes Documents, and it causes synchronization
> issues with Dropbox (I confirm this one), OneDrive, and users with
> Network IT policies.
>
> The vast majority of R users won't touch that folder and don't need it
> backed up. And, its contents are not really "documents".

I very much support this request. R's behavior of defaulting HOME to
an unusual (legacy) directory is also a source of bugs and
interoperability problems:

R packages that interface c/c++ libraries that require a user config
file (libssh, libgit2, etc) sometimes cannot find the user config
because it gets stored on a different location than expected. A good
example is 'git'. The 'git for windows' command line utility stores my
user config in C:\users\Jeroen\.gitconfig. However, for R packages
that link to libgit2 (e.g. git2r, gert) the user config gets
loaded/stored from C:\users\Jeroen\Documents\.gitconfig because
libgit2 inherits the R home directory. Having 2 different git
configurations is obviously confusing for users.

Another problem is that when you start R from "windows bash" or the
msys2 shell (including "git for windows" or rtools40), the "~"
directory is different than in RGui. This is because these shells do set
the HOME variable (to the usual value), and R inherits that.

For example: when I start R in RGui for Windows I see:

  > normalizePath("~")
  [1] "C:\\Users\\jeroen\\Documents"

But when I start R or Rterm from the "git for windows" shell we get:

  > normalizePath("~")
  [1] "C:\\Users\\jeroen"

An ambiguous home directory is obviously going to break R code that
refers to paths in your home.

Because these problems affect all Windows users, I think the benefits
of fixing the default behavior easily outweigh the
backward-compatibility and "there is a documented workaround"
arguments.

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Feature request: Change default library path on Windows

2021-07-25 Thread Steve Haroz
> I think the benefits of fixing the default behavior easily outweigh the
> backward-compatibility and "there is a documented workaround"
> arguments.

Exactly. This is an accessibility issue and a serious barrier for some
beginners. It's possible to work around the error message, but users
should not have to do a workaround the very first time they install a
couple libraries.
Many users synching with one of several popular cloud services and
many users whose Documents folder is managed by a Network IT policy
will run into this issue.

Moving the R libraries from USER/Documents/R to USER/R will help avoid
"attrition" of beginners.

-Steve

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Feature request: Change default library path on Windows

2021-07-25 Thread Duncan Murdoch

On 25/07/2021 6:17 a.m., Steve Haroz wrote:

I think the benefits of fixing the default behavior easily outweigh the
backward-compatibility and "there is a documented workaround"
arguments.


Exactly. This is an accessibility issue and a serious barrier for some
beginners. It's possible to work around the error message, but users
should not have to do a workaround the very first time they install a
couple libraries.
Many users synching with one of several popular cloud services and
many users whose Documents folder is managed by a Network IT policy
will run into this issue.

Moving the R libraries from USER/Documents/R to USER/R will help avoid
"attrition" of beginners.


Shouldn't it be in one of the AppData directories?  (I'm not sure of 
this; Windows guidelines for file locations are not easy to find, and 
change between versions.)


Duncan Murdoch

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Feature request: Change default library path on Windows

2021-07-25 Thread Steve Haroz
> Shouldn't it be in one of the AppData directories?

I asked that same question on twitter. Here was a response
(https://twitter.com/bmwiernik/status/1419033079495147522):
* But it's not for files that should be user-accessible, like a
library (cf. Zotero has preferences in AppData , but library files in
%USERPROFILE%/Zotero)
* So, for example, in R's case it could make sense for the core
packages to be installed in %APPDATA%/R/R-4.1.0/library" rather than
"C:/Program Files/R/R-4.1.0/library" (either is fairly common), but
user packages should be somewhere more accessible.

Here is a quote from
https://docs.microsoft.com/en-us/windows/apps/design/app-settings/store-and-retrieve-app-data:
"App data is mutable data that is created and managed by a specific
app. It includes runtime state, app settings, user preferences,
reference content (such as the dictionary definitions in a dictionary
app), and other settings"
I don't think libraries fall into the categories of state or settings.

-Steve Haroz

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Feature request: Change default library path on Windows

2021-07-25 Thread Gabor Grothendieck
At the very least it would be nice if there were a function that displays all
the locations/paths currently being used in R.

On Sat, Jul 24, 2021 at 6:15 PM Steve Haroz  wrote:
>
> Hello,
>
> I'd like to propose moving the default library install location on Windows 
> from:
> %USERPROFILE%/Documents/R
> to some other location such as:
> %USERPROFILE%/R
>
> For many users the Documents folder is backed up or synchronized.
> Installing libraries thrashes Documents, and it causes synchronization
> issues with Dropbox (I confirm this one), OneDrive, and users with
> Network IT policies.
>
> The vast majority of R users won't touch that folder and don't need it
> backed up. And, its contents are not really "documents".
>
> There are many blog posts and websites with people complaining about
> it or offering workarounds that involve hand editing setting and
> environment files, which reduces R's usability and accessibility.
> * 
> https://community.rstudio.com/t/help-regarding-package-installation-renviron-rprofile-r-libs-r-libs-site-and-r-libs-user-oh-my/13888/5
> * https://accelebrate.com/library/how-to-articles/r-rstudio-library
> * 
> https://community.rstudio.com/t/r-studio-library-installation-directory/30725/2
> * https://twitter.com/sharoz/status/1418712098444546057
> * https://twitter.com/JoeHilgard/status/1419025358070878210
>
> This change should not interfere with any project environment managers
> like renv. It should just change the global default for Windows R
> users.
> Also, I believe that on Mac it is not in Documents, but it's in the
> equivalent of %USERPROFILE%/R.
>
> Thanks,
> Steve Haroz
>
> __
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel



-- 
Statistics & Software Consulting
GKX Group, GKX Associates Inc.
tel: 1-877-GKX-GROUP
email: ggrothendieck at gmail.com

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Feature request: Change default library path on Windows

2021-07-25 Thread Gabriel Becker
On Sun, Jul 25, 2021, 6:54 AM Steve Haroz  wrote:

> > Shouldn't it be in one of the AppData directories?
>
> I asked that same question on twitter. Here was a response
> (https://twitter.com/bmwiernik/status/1419033079495147522):
> * But it's not for files that should be user-accessible, like a
> library (cf. Zotero has preferences in AppData , but library files in
> %USERPROFILE%/Zotero)
> * So, for example, in R's case it could make sense for the core
> packages to be installed in %APPDATA%/R/R-4.1.0/library" rather than
> "C:/Program Files/R/R-4.1.0/library" (either is fairly common), but
> user packages should be somewhere more accessible.
>
> Here is a quote from
>
> https://docs.microsoft.com/en-us/windows/apps/design/app-settings/store-and-retrieve-app-data
> :
> "App data is mutable data that is created and managed by a specific
> app. It includes runtime state, app settings, user preferences,
> reference content (such as the dictionary definitions in a dictionary
> app), and other settings"
> I don't think libraries fall into the categories of state or settings.
>

Well, no,  but installed, and thus available for use by scripts, extension
packages are somewhat more comparable to dictionary definitions in in a
dictionary app.

They seem fairly analogous, in fact. Packages are essentially dictionaries
of available functions that scripts (equivalent roughly to text documents
here) can call.

That said I dont have a super strong opinion and don't use windows, just
pointing out that its not clear this would violate the intent of the cited
guidance.

Another option would be to allow users to set the default library location
from within the windows installer (if you can't already).

~G




> -Steve Haroz
>
> __
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

[[alternative HTML version deleted]]

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Feature request: Change default library path on Windows

2021-07-25 Thread Steve Haroz
> That said I dont have a super strong opinion
Neither do I. As long as it's somewhere other than USER/Documents

> Another option would be to allow users to set the default library location 
> from within the windows installer (if you can't already).
Currently, there is no option during install, but that is a separate issue.
I'm more concerned with the default location rather than how to change
it. Users won't know that the current default (User/Documents) is
incompatible with their cloud service until after they've installed R
and tried adding libraries.

-Steve

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Feature request: Change default library path on Windows

2021-07-25 Thread Duncan Murdoch

On 25/07/2021 9:54 a.m., Steve Haroz wrote:

Shouldn't it be in one of the AppData directories?


I asked that same question on twitter. Here was a response
(https://twitter.com/bmwiernik/status/1419033079495147522):
* But it's not for files that should be user-accessible, like a
library (cf. Zotero has preferences in AppData , but library files in
%USERPROFILE%/Zotero)
* So, for example, in R's case it could make sense for the core
packages to be installed in %APPDATA%/R/R-4.1.0/library" rather than
"C:/Program Files/R/R-4.1.0/library" (either is fairly common), but
user packages should be somewhere more accessible.

Here is a quote from
https://docs.microsoft.com/en-us/windows/apps/design/app-settings/store-and-retrieve-app-data:
"App data is mutable data that is created and managed by a specific
app. It includes runtime state, app settings, user preferences,
reference content (such as the dictionary definitions in a dictionary
app), and other settings"
I don't think libraries fall into the categories of state or settings.


I saw that link, and like you and Gabe, found it somewhat ambiguous.

I don't know bmwiernik, but from the sound of it, he doesn't speak for 
Microsoft.


So I would say that I still believe Microsoft doesn't give clear 
guidance for this.  Yes, %USERPROFILE%/R has some non-Microsoft 
precedents, but that's irrelevant.  This is an issue to take up with MS, 
not with R.  Let them describe *clearly* what they want, and R will 
(eventually) do it (but probably not before they've changed their clear 
guidance).


Duncan Murdoch

P.S. I am a former member of R Core who did Windows support.  I now 
detest that OS.  I suspect nobody who is still on R Core doesn't detest it.


__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Feature request: Change default library path on Windows

2021-07-25 Thread Avraham Adler
On Sun, Jul 25, 2021 at 5:56 PM Duncan Murdoch 
wrote:

> On 25/07/2021 9:54 a.m., Steve Haroz wrote:
> >> Shouldn't it be in one of the AppData directories?
> >
> > I asked that same question on twitter. Here was a response
> > (https://twitter.com/bmwiernik/status/1419033079495147522):
> > * But it's not for files that should be user-accessible, like a
> > library (cf. Zotero has preferences in AppData , but library files in
> > %USERPROFILE%/Zotero)
> > * So, for example, in R's case it could make sense for the core
> > packages to be installed in %APPDATA%/R/R-4.1.0/library" rather than
> > "C:/Program Files/R/R-4.1.0/library" (either is fairly common), but
> > user packages should be somewhere more accessible.
> >
> > Here is a quote from
> >
> https://docs.microsoft.com/en-us/windows/apps/design/app-settings/store-and-retrieve-app-data
> :
> > "App data is mutable data that is created and managed by a specific
> > app. It includes runtime state, app settings, user preferences,
> > reference content (such as the dictionary definitions in a dictionary
> > app), and other settings"
> > I don't think libraries fall into the categories of state or settings.
>
> I saw that link, and like you and Gabe, found it somewhat ambiguous.
>
> I don't know bmwiernik, but from the sound of it, he doesn't speak for
> Microsoft.
>
> So I would say that I still believe Microsoft doesn't give clear
> guidance for this.  Yes, %USERPROFILE%/R has some non-Microsoft
> precedents, but that's irrelevant.  This is an issue to take up with MS,
> not with R.  Let them describe *clearly* what they want, and R will
> (eventually) do it (but probably not before they've changed their clear
> guidance).
>
> Duncan Murdoch
>
> P.S. I am a former member of R Core who did Windows support.  I now
> detest that OS.  I suspect nobody who is still on R Core doesn't detest it.



I remember well and greatly appreciate your work, Dr. Murdoch. As someone
whose R work must be almost exclusively on Windows due to the nature of my
employment, I want to once again show appreciation to the members of R Core
and others, specifically Drs. Liggs and Tierney, and Jeroen Oomes, Dirk
Eddelbuttel, and the many others who continue to support R for Windows.

Avi

> --
Sent from Gmail Mobile

[[alternative HTML version deleted]]

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Feature request: Change default library path on Windows

2021-07-25 Thread Steve Haroz
> So I would say that I still believe Microsoft doesn't give clear
> guidance for this.

Sure, there is some ambiguity on where MS would prefer these kinds of
files. But what is clear is that the current location USER/Documents
is causing a serious issue.

And while we can all understand frustration with Microsoft, Windows
users represent a major proportion of the R install base. So let's see
what we can do to help out those users. Changing the default location
to either USER/R or USER/AppData/Local/R would help a lot of users,
both beginners and those with moderate experience who switch to a new
cloud backup.

Microsoft is unlikely to put out new guidance any time soon. And the
current guidance doesn't seem opposed to putting R libraries in either
suggested location. So how about we just pick one (I suggest USER/R
for simplicity) and discuss how to go about making the change?

-Steve

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Feature request: Change default library path on Windows

2021-07-25 Thread Ben Bolker
  Given (AFAICS) the absence of any actual R-core members 
 chiming into the 
discussion here, and provided that you think that the issue has been 
sufficiently discussed, I would say the next step ("how to go about 
making the change") is to compose & submit a wishlist request to the R 
bug tracker ...
  It might also be worth reaching out to/double-checking with Jeroen 
Ooms (Rtools maintainer and Windows infrastructure expert; I don't know 
if he has any more formal association with R-core/CRAN ?)


  cheers
   Ben Bolker


On 7/25/21 6:35 PM, Steve Haroz wrote:

So I would say that I still believe Microsoft doesn't give clear
guidance for this.


Sure, there is some ambiguity on where MS would prefer these kinds of
files. But what is clear is that the current location USER/Documents
is causing a serious issue.

And while we can all understand frustration with Microsoft, Windows
users represent a major proportion of the R install base. So let's see
what we can do to help out those users. Changing the default location
to either USER/R or USER/AppData/Local/R would help a lot of users,
both beginners and those with moderate experience who switch to a new
cloud backup.

Microsoft is unlikely to put out new guidance any time soon. And the
current guidance doesn't seem opposed to putting R libraries in either
suggested location. So how about we just pick one (I suggest USER/R
for simplicity) and discuss how to go about making the change?

-Steve

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel



__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Feature request: Change default library path on Windows

2021-07-25 Thread Duncan Murdoch

On 25/07/2021 7:23 p.m., Ben Bolker wrote:

Given (AFAICS) the absence of any actual R-core members
 chiming into the
discussion here, and provided that you think that the issue has been
sufficiently discussed, I would say the next step ("how to go about
making the change") is to compose & submit a wishlist request to the R
bug tracker ...


With a patch attached, it might be accepted.

Duncan Murdoch


It might also be worth reaching out to/double-checking with Jeroen
Ooms (Rtools maintainer and Windows infrastructure expert; I don't know
if he has any more formal association with R-core/CRAN ?)

cheers
 Ben Bolker


On 7/25/21 6:35 PM, Steve Haroz wrote:

So I would say that I still believe Microsoft doesn't give clear
guidance for this.


Sure, there is some ambiguity on where MS would prefer these kinds of
files. But what is clear is that the current location USER/Documents
is causing a serious issue.

And while we can all understand frustration with Microsoft, Windows
users represent a major proportion of the R install base. So let's see
what we can do to help out those users. Changing the default location
to either USER/R or USER/AppData/Local/R would help a lot of users,
both beginners and those with moderate experience who switch to a new
cloud backup.

Microsoft is unlikely to put out new guidance any time soon. And the
current guidance doesn't seem opposed to putting R libraries in either
suggested location. So how about we just pick one (I suggest USER/R
for simplicity) and discuss how to go about making the change?

-Steve

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel



__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel



__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Feature request: Change default library path on Windows

2021-07-25 Thread Steve Haroz
Thanks Ben. I just sent a request for a bugzilla login.
Jeroen chimed in earlier in support.

Cheers,
Steve

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel