Description Usage Arguments Details Author(s)
create a nimbleFunction from a setup function, run
function, possibly other methods, and possibly inheritance
via contains
1 2 |
setup |
An optional R function definition for setup processing. |
run |
An optional NIMBLE function definition the executes the primary job of the nimbleFunction |
methods |
An optional named list of NIMBLE function
definitions for other class methods that can be called
via |
contains |
An optional object returned from
|
name |
An optional name used internally, for example in generated C++ code. Usually this is left blank and NIMBLE provides a name. |
where |
An optional |
This is the main function for defining nimbleFunctions. A lot of information is provided in the NIMBLE User Manual, so only a brief summary will be made here.
If a setup
function is provided, then
nimbleFunction
returns a generator: a function that
when called with arguments for the setup function will
execute that function and return a specialized
nimbleFunction. When the specialized nimbleFunction is
called, the run
function is executed, which can use
objects that were created in or passed to the setup
function. Additional member functions provided in the
methods
argument can be accessed using
nfMethod
.
If no setup
function is provided, then
nimbleFunction
returns a function that executes the
run
function. It is not a generator in this case,
and no other methods
can be provided.
If one wants a generator but does not need any setup
arguments or code, setup = TRUE
can be used.
See the NIMBLE User Manual for examples.
For more information about the contains
argument,
see the section on nimbleFunctionLists.
NIMBLE development team
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.