Find a component in one or more repos. Returns NULL if no repo contains
it, while get_component() raises an error. Local repo directories must
exist, otherwise an error is raised.
Arguments
- component
character(1)Component name. IfreposisNULL, path to a component file.- 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 once with
mighty_repos().
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: 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)
