Description Usage Arguments Value
View source: R/options_attach.R
This function is a wrapper around attach
, that in addition
performs an update of the options. The idea is that an option can
store the names of several attached objects, and latter on when
it's time to clean up it should be sufficient to specify the
relevant option in order to detach
. Note that the function
performs a sanity-check to ensure that no options set by other
packages should be affected. The defaults for those arguments that
are to be sent to attach
, are inherited from that function.
1 2 3 | options_attach(what, pos = 2L, name = deparse(substitute(what)),
warn.conflicts = TRUE, options_name, options_front = TRUE,
replace = TRUE)
|
what |
The object to attach. Note: This argument will be sent
to the |
pos |
The position in |
name |
The name to use for the attached object. Names
starting with |
warn.conflicts |
Logical argument. When this is |
options_name |
A character string that specifies the name of
the option to be used when storing the names of the attached
environments. Note that |
options_front |
A logical value, default |
replace |
A logical value, default |
When successful, the function will attach the object
specified in what
and add its name
to the option
options_name
as specified by options_front
.
Depending on the value of replace
, any old attached
environment with the same name as the present one will be
replaced. Note: No replacement will be done if the new and the
old environment contains the same content. If the positional
order on the search-path is important, that might require that
the existing environment has to be detached first.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.