find_downstream

Find projects that depend on a given package

Description

Scans DESCRIPTION files in project directories under scan_dir for Depends, Imports, or LinkingTo fields that reference package.

Usage

1find_downstream(package, scan_dir = path.expand("~"),
2                exclude = default_exclude())

Arguments

  • package: Character. Package name to search for.
  • scan_dir: Directory to scan for project directories.
  • exclude: Character vector of directory basenames to skip.

Value

Character vector of project names that depend on package.

Examples

1d <- file.path(tempdir(), "dsdir")
2dir.create(d, showWarnings = FALSE)
3pkg <- file.path(d, "child")
4dir.create(pkg, showWarnings = FALSE)
5writeLines(c("Package: child", "Version: 0.1.0", "Imports: parent"),
6           file.path(pkg, "DESCRIPTION"))
7find_downstream("parent", scan_dir = d)