Learn R Programming

statnet.common (version 4.10.0)

default_options: Set options() according to a named list, skipping those already set.

Description

This function can be useful for setting default options, which do not override options set elsewhere.

Usage

default_options(...)

Value

The return value is same as that of options() (omitting options already set).

Arguments

...

see options(): either a list of name=value pairs or a single unnamed argument giving a named list of options to set.

Examples

Run this code
options(onesetting=1)

default_options(onesetting=2, anothersetting=3)
stopifnot(getOption("onesetting")==1) # Still 1.
stopifnot(getOption("anothersetting")==3)

default_options(list(yetanothersetting=5, anothersetting=4))
stopifnot(getOption("anothersetting")==3) # Still 3.
stopifnot(getOption("yetanothersetting")==5)

Run the code above in your browser using DataLab