spsOption: Get or set SPS options

Description Usage Arguments Value Examples

View source: R/spsUtil.R

Description

Some functions in spsUtil, spsComps and systempPipeShiny will behave differently if some SPS options are changed, but it is optional. All functions have a default value. If SPS options are not changed, they will just use the default setting. Read help files of individual functions for detail.

Usage

1
spsOption(opt, value = NULL, .list = NULL, empty_is_false = TRUE)

Arguments

opt

string, length 1, what option you want to get or set

value

if this is not NULL, this function will set the option you choose to this value

.list

list, set many SPS options together at once by passing a list to this function.

empty_is_false

bool, when trying to get an option value, if the option is NULL, NA, "" or length is 0, return FALSE?

Value

return the option value if value exists; return FALSE if the value is empty, like NULL, NA, ""; return NULL if empty_is_false = FALSE; see notFalsy

If value != NULL will set the option to this new value, no returns.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
spsOption("test1") # get a not existing option
spsOption("test1", 1) # set the value
spsOption("test1") # get the value again
spsOption("test2")
spsOption("test2", empty_is_false = FALSE)
spsOption(.list = list(
    test1 = 123,
    test2 = 456
))
spsOption("test1")
spsOption("test2")

spsUtil documentation built on Oct. 31, 2021, 1:06 a.m.