WISH: Sys.setlocale() to return value invisibly

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

WISH: Sys.setlocale() to return value invisibly

Henrik Bengtsson-5
Contrary to, say, Sys.setenv(), Sys.setlocale() returns it's value
visibly.  This means that if you for instance add:

Sys.setlocale("LC_COLLATE", "C")

to your .Rprofile file, it will print:

[1] "C"

at startup. The workaround is to wrap the call in invisible(), but I'd
argue that any "setter" function should return invisibly.

Some more details:

> withVisible(Sys.setlocale("LC_COLLATE", "C"))
$value
[1] "C"

$visible
[1] TRUE

> withVisible(Sys.setenv(FOO = "C"))
$value
[1] TRUE

$visible
[1] FALSE

/Henrik

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel