Skip to contents

Reconciles the parameters with the arguments from xl() and stores the new defaults session in options()

Usage

set_xl_args(..., reset = FALSE)

Arguments

...

parameters and arguments from xl()

reset

remove the global xl() option arguments currently set

Value

current default args (invisibly)

See also

Examples

(store_options <- getOption('xlr.xl'))
#> NULL

set_xl_args(reset = TRUE)
#>  Removing existing `xl()` default arguments:
#> 
#> NULL
#> 
set_xl_args(.quiet = TRUE, .tabname_spec = list(zoom = 65))
#>  Options set:
#> 
#> $.quiet
#> [1] TRUE
#> 
#> $.tabname_spec
#> $.tabname_spec$zoom
#> [1] 65
#> 
#> 
#> 
getOption('xlr.xl')
#> $.quiet
#> [1] TRUE
#> 
#> $.tabname_spec
#> $.tabname_spec$zoom
#> [1] 65
#> 
#> 
set_xl_args(.workbook_spec = list(asTable = FALSE, zoom = 85, withFilter = TRUE))
#>  Options set:
#> 
#> $.quiet
#> [1] TRUE
#> 
#> $.tabname_spec
#> $.tabname_spec$zoom
#> [1] 65
#> 
#> 
#> $.workbook_spec
#> $.workbook_spec$asTable
#> [1] FALSE
#> 
#> $.workbook_spec$zoom
#> [1] 85
#> 
#> $.workbook_spec$withFilter
#> [1] TRUE
#> 
#> 
#> 
getOption('xlr.xl')
#> $.quiet
#> [1] TRUE
#> 
#> $.tabname_spec
#> $.tabname_spec$zoom
#> [1] 65
#> 
#> 
#> $.workbook_spec
#> $.workbook_spec$asTable
#> [1] FALSE
#> 
#> $.workbook_spec$zoom
#> [1] 85
#> 
#> $.workbook_spec$withFilter
#> [1] TRUE
#> 
#> 
set_xl_args(.quiet = FALSE, reset = TRUE)
#>  Removing existing `xl()` default arguments:
#> 
#> $.quiet
#> [1] TRUE
#> 
#> $.tabname_spec
#> $.tabname_spec$zoom
#> [1] 65
#> 
#> 
#> $.workbook_spec
#> $.workbook_spec$asTable
#> [1] FALSE
#> 
#> $.workbook_spec$zoom
#> [1] 85
#> 
#> $.workbook_spec$withFilter
#> [1] TRUE
#> 
#> 
#> 
#>  Options set:
#> 
#> $.quiet
#> [1] FALSE
#> 
#> 
set_xl_args(.sheet_titles = toupper)
#>  Options set:
#> 
#> $.quiet
#> [1] FALSE
#> 
#> $.sheet_titles
#> function (x) 
#> {
#>     if (!is.character(x)) 
#>         x <- as.character(x)
#>     .Internal(toupper(x))
#> }
#> <bytecode: 0x55bd7ce9b0d0>
#> <environment: namespace:base>
#> 
#> 

# restore original options
set_xl_args(store_options, reset = TRUE)
#>  Removing existing `xl()` default arguments:
#> 
#> $.quiet
#> [1] FALSE
#> 
#> $.sheet_titles
#> function (x) 
#> {
#>     if (!is.character(x)) 
#>         x <- as.character(x)
#>     .Internal(toupper(x))
#> }
#> <bytecode: 0x55bd7ce9b0d0>
#> <environment: namespace:base>
#> 
#> 
#>  Options set:
#> 
#> NULL
#>