Skip to content
Prev 35757 / 63424 Next

Package options

On 03/02/2010 8:07 AM, Chris Brien wrote:
Do you want this option to persist to the next session if a user saves 
the workspace?  If so, then it should be stored in a variable in the 
global environment.  You can use assign(".FooOptions", value, 
envir=globalenv()) to set it, and get(".FooOptions", envir=globalenv())
to read it.

The obvious problem with this is that the user might already have a 
.FooOptions variable defined, and your code would stomp on it.  An 
alternative is to store the variable into the namespace.  You need to 
unlock it to change it.  See tools:::startDynamicHelp for code that does 
this for the variable httpdPort.

Duncan Murdoch