Title: | Set Options if Unset |
---|---|
Description: | A single function 'options.ifunset(...)' is contained herewith, which allows the user to set a global option ONLY if it is not already set. By this token, for package maintainers this function can be used in preference to the standard 'options(...)' function, making provision for THEIR end user to place 'options(...)' directives within their '.Rprofile' file, which will not be overridden at the point when a package is loaded. |
Authors: | Nicholas Hamilton |
Maintainer: | Nicholas Hamilton <[email protected]> |
License: | GPL-2 |
Version: | 1.0 |
Built: | 2024-12-06 06:41:50 UTC |
Source: | CRAN |
Set an option only if is not currently set
This package contains a single function which only updates the global options if the option is presently unset
options.ifunset(width=100) #NO CHANGE, ALREADY EXISTS options.ifunset(myuniqueoption=TRUE) #NEW Option Created
options.ifunset(width=100) #NO CHANGE, ALREADY EXISTS options.ifunset(myuniqueoption=TRUE) #NEW Option Created
This function will set an option if it isn't already present within the global options
returned by the options()
function
options.ifunset(..., force = FALSE)
options.ifunset(..., force = FALSE)
... |
any options can be defined, using Options can also be passed by giving a single unnamed argument which is a named list. |
force |
Force the Option to Be Set |
options.ifunset(width=10) #IGNORED, ALREADY EXISTS options.ifunset(width=10,force=TRUE) #FORCED UPDATE TO OPTION options.ifunset(myoption=TRUE) #New Option is Created
options.ifunset(width=10) #IGNORED, ALREADY EXISTS options.ifunset(width=10,force=TRUE) #FORCED UPDATE TO OPTION options.ifunset(myoption=TRUE) #New Option is Created