Retrieve a mighty code component.
get_component(): Returns an object of classmighty_component.get_rendered_component(): Returns an object of classmighty_component_rendered.
When rendering a component the required list of parameters depends on the individual component. Check the documentation of the local component for details.
Usage
get_component(component, repos = NULL)
get_rendered_component(component, params = list(), repos = NULL)Details
Processes different component types based on file extension:
.R: Extracts and renders custom functions..mustache: Creates components from the template files.
The repos parameter accepts a character vector of locations to search,
in priority order. Each element is either a local directory path or a
GitHub source in owner/repo, owner/repo/subdir, or owner/repo@ref
format. The first match is returned. Defaults to the current directory.
Examples
path <- system.file("examples", "ady.mustache", package = "mighty.component")
get_component(path)
#> <mighty_component/R6>
#> ady.mustache: Derives the relative day compared to the treatment start date.
#> Type: column
#> Parameters:
#> • domain: `character` Name of new domain being created
#> • variable: `character` Name of new variable to create
#> • date: `character` Name of date variable to use
#> Depends:
#> • {{{domain}}}.{{{date}}}
#> • {{{domain}}}.TRTSDT
#> Outputs:
#> • {{{variable}}}
