Learn R Programming

mighty.component (version 0.2.0)

list_components: List components in repos

Description

List the components in one or more repos. See mighty_repo() for the component layout. Files starting with test- are not listed.

Usage

list_components(repos, as = c("character", "list", "tibble"))

Value

Depending on as:

  • "character": character vector of unique component names.

  • "list": list with one element per component, each a named list with id, title, description, type, origin, method, params, depends, outputs and code.

  • "tibble": tibble with one row per component and the same columns.

Arguments

repos

Where to look. One of:

  • character vector of repo specs. See mighty_repo().

  • A mighty_repo_class object.

  • A list of repo specs or mighty_repo_class objects.

  • A mighty_repos() collection.

Character vectors and lists are converted once with mighty_repos().

as

Format to list the components in:

  • "character": component names (filenames without extension).

  • "list": metadata for each component.

  • "tibble": metadata for each component as a tibble. Requires the tibble and tidyr packages.

When a component exists in several repos, the metadata is taken from the first repo, as in find_component().

See Also

get_component(), find_component()

Examples

Run this code
path <- system.file("examples", package = "mighty.component")
list_components(path)

list_components(path, as = "list") |>
  str(max.level = 2)

Run the code above in your browser using DataLab