Look up a component in one or more repos. Unlike get_component(),
returns NULL instead of raising an error when no repo contains the
component. Each repo directory must exist, otherwise an error is raised.
Arguments
- component
charactercomponent name, or path to a component file (.Ror.mustache) whenreposisNULL. The directory of the path must exist.- repos
Where to look. One of:
NULL(default):componentis a file path.charactervector of repo specs, in priority order. Seemighty_repo().A
mighty_repo_classobject.A
listof repo specs ormighty_repo_classobjects, in priority order.A
mighty_repos()collection.
Character vectors and lists are converted with
mighty_repos(). GitHub refs are resolved once per session. Seemighty_repo_github().
Value
A mighty_component object, or NULL if no repo contains the
component.
Examples
path <- system.file("examples", package = "mighty.component")
find_component("ady", repos = path)
#> → Found "ady" in "local::/home/runner/work/_temp/Library/mighty.component/examples"
#> <mighty_component/R6>
#> ady.mustache: Analysis relative day
#> 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}}}
find_component("does_not_exist", repos = path)
