Learn R Programming

mighty.component (version 0.2.0)

find_component: Find a component

Description

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.

Usage

find_component(component, repos = NULL)

Value

A mighty_component object, or NULL if no repo contains the component.

Arguments

component

character(1) Component name. If repos is NULL, path to a component file.

repos

Where to look. One of:

  • NULL (default): component is a file path.

  • character vector of repo specs, in priority order. See mighty_repo().

  • A mighty_repo_class object.

  • A list of repo specs or mighty_repo_class objects, in priority order.

  • A mighty_repos() collection.

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

See Also

get_component(), list_components()

Examples

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

find_component("does_not_exist", repos = path)

Run the code above in your browser using DataLab