Re: [R] Persistent storage between package invocations

From: Hadley Wickham <>
Date: Wed, 16 Mar 2011 08:00:17 -0500

> No.  First, please use path.expand("~") for this, and it does not
> necessarily mean the home directory (and in principle it might not expand at
> all).  In practice I think it will always be *a* home directory, but on
> Windows there may be more than one (and watch out for local/roaming profile
> differences).

Ok - I did remember that something like path.expand existed, I just couldn't find it. (And I always get confused by the difference between normalizePath and path.expand).

> Second, it need not be writeable, and so many package authors write rubbish
> in my home directory that I usually arrange it not be writeable to R test
> processes.

So at a minimum I need to check if the "home" directory is writeable, and fail gracefully if not.

What about using the registry on windows? Does R provide any convenience functions for adding/accessing entries?

> If you want something writeable across processes, use dirname(tempdir()) .

I was really looking for options to be persistent between instances - i.e. so you decide once, and not need to be asked again. In a similar way, it would be nice if you could choose a CRAN mirror once and then not be asked again - and not need to know anything about how to set options during startup.


Assistant Professor / Dobelman Family Junior Chair
Department of Statistics / Rice University

______________________________________________ mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.
Received on Wed 16 Mar 2011 - 13:15:13 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 18 Mar 2011 - 09:00:23 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive