do_call_assign | R Documentation |
Apply a function to a list of objects, merge the outputs into a single object, and assign the object to the output environment.
do_call_assign(
func,
symbolv = NULL,
output,
env_in = .GlobalEnv,
env_out = .GlobalEnv,
...
)
func |
The name of a function that returns a single object (vector, xts time series, etc.) |
symbolv |
A vector of character strings with the names of input objects. |
output |
The string with name of output object. |
env_in |
The environment containing the input |
env_out |
The environment for creating the |
... |
Additional arguments to function |
The function do_call_assign()
performs an lapply loop over
symbolv
, applies the function func()
, merges the
outputs into a single object, and creates the object in the environment
env_out
. The output object is created as a side effect, while its
name is returned invisibly.
A single object (matrix, xts time series, etc.)
new_env <- new.env()
rutils::do_call_assign(
func=get_col,
symbolv=rutils::etfenv$symbolv,
output="prices",
env_in=etfenv, env_out=new_env)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.