Learn R Programming

spsUtil (version 0.2.2.1)

spsOption: Get or set SPS options

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

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

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.

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`?

Examples

Run this code
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")

Run the code above in your browser using DataLab