Skip to contents

Used by the module's corrective re-run for a could not find function "X" error that no file in the paper's own code defines (the sibling case to repro_defined_vars()'s repo-file lookup, for when the missing symbol is a PACKAGE export the author simply forgot to library(), not a local variable/function). Deliberately scoped, not a blind search of every installed or CRAN package: only candidates (the paper's own declared dependencies plus .repro_common_pkgs()'s small curated safe-list) are checked, so an ambiguous common name (%>%, select, ...) across the package universe at large is never even considered — see this function's caller for why a blind scan is unsafe (a real corpus check found %>% alone exported by 69 installed packages).

Usage

.repro_find_export_pkg(name, candidates)

Arguments

name

the undefined symbol (e.g. "test_that", "%>%")

candidates

character vector of candidate package names to check (already scoped by the caller — see above)

Value

the single package name that exports name, or NA_character_ when zero or more than one candidate does (never guessed)

Details

A candidate package that is not installed is silently skipped (not an error): this only ever runs against packages already usable in the current R installation, since BiocManager/remotes-style live lookups are out of scope for a same-process check like this one.