Set Container Package Options
Value
container_options()
returns a list of all set options sorted by name.container_options(name)
, a list of length one containing the set value, orNULL
if it is unset. Can also be multiple names (see Examples).container_options(key = value)
sets the option with namekey
tovalue
and returns the previous options invisibly.
Container Options
compare
(default =all.equal
)useDots
(default =TRUE
) whether to abbreviate long container elements with...
when exceedingvec.len
(see below). IfFALSE
, they are abbreviated as<<type(length)>>
.vec.len
(default = 4) the length limit at which container vectors are abbreviated.
Examples
co = container(1L, 1:10, as.list(1:5))
co
#> [1L, (1L 2L 3L 4L ...), <<list(5)>>]
container_options(useDots = FALSE)
co
#> [1L, <<integer(10)>>, <<list(5)>>]
container_options(useDots = TRUE, vec.len = 6)
co
#> [1L, (1L 2L 3L 4L 5L 6L ...), list(1L, 2L, 3L, 4L, 5L)]
has(co, 1.0)
#> [1] TRUE
container_options(compare = "identical")
has(co, 1.0) # still uses 'all.equal'
#> [1] TRUE
co2 = container(1L)
has(co2, 1.0)
#> [1] FALSE
has(co2, 1L)
#> [1] TRUE
container_options()
#> $compare
#> [1] "identical"
#>
#> $useDots
#> [1] TRUE
#>
#> $vec.len
#> [1] 6
#>
container_options(.reset = TRUE)
#> $compare
#> [1] "all.equal"
#>
#> $useDots
#> [1] TRUE
#>
#> $vec.len
#> [1] 4
#>