Package 'optifunset'

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

Help Index


OptIfUnset Package

Description

Set an option only if is not currently set

Details

This package contains a single function which only updates the global options if the option is presently unset

Examples

options.ifunset(width=100)  #NO CHANGE, ALREADY EXISTS
options.ifunset(myuniqueoption=TRUE) #NEW Option Created

Set Options if Unset

Description

This function will set an option if it isn't already present within the global options returned by the options() function

Usage

options.ifunset(..., force = FALSE)

Arguments

...

any options can be defined, using name = value, if they are not already defined.

Options can also be passed by giving a single unnamed argument which is a named list.

force

Force the Option to Be Set

Examples

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