[Rd] Suggestions for an "official" place to store permissions/options for a package?

Jonathan Greenberg jgrn at illinois.edu
Sat Oct 19 02:32:49 CEST 2013


Duncan Murdoch suggested I move a post I started on r-help over here,
since it is more at the developer level.  Here is my
question/challenge -- to my knowledge, there is not currently an
official way to store a *package*'s options to a standardized location
on a user's computer.  Given that OS-level programs have standard
preference locations, I was hoping to first assess:

- Does R, in fact, have a place for a *package* to store preferences
(a file-based "setOptions") that would be persistent across sessions.

One suggestion that was given was to perhaps write these options to
the .RProfile, but this strikes me as potentially dangerous -- a
poorly written function to write to a user's .RProfile could corrupt

If the answer to the initial question is "no" (there is not an
official location/approach for a package to store its own files), I'd
like to suggest we open this for a wider discussion amongst the
developers, to perhaps come up with a general (not package-by-package)
solution for a package to store options (and perhaps other files) in a
standard location.

The particular application that has brought me to asking about this is
that I'm writing a package that has external calls to command-line
programs that may not be properly registered with a user's environment
(think: Windows, in particular, although I've found issues with a Mac
as well), so the first step of these R - wrapper functions is to
search a user's local machine for the binaries.  If it finds it, it
stores the path to this binary as an option.  Since this is a
brute-force search, this can take some time and, ideally, this
information would be preserved across sessions, without the function
having to re-search their drive every time they start R fresh.


Jonathan A. Greenberg, PhD
Assistant Professor
Global Environmental Analysis and Remote Sensing (GEARS) Laboratory
Department of Geography and Geographic Information Science
University of Illinois at Urbana-Champaign
259 Computing Applications Building, MC-150
605 East Springfield Avenue
Champaign, IL  61820-6371
Phone: 217-300-1924
AIM: jgrn307, MSN: jgrn307 at hotmail.com, Gchat: jgrn307, Skype: jgrn3007

More information about the R-devel mailing list