Skip to contents

replicateEverything has two sides. On the consumer side you browse the registry, run a table or figure, and inspect the code that produced it. On the producer side you set up a study repository, validate it, and register it so others can replicate your work.

Start with the overview: vignette("why-replicateEverything", package = "replicateEverything").

This vignette walks through the main exported functions on each side. For full contributor checklists see the folder and package replication articles; for Stata-specific behaviour see Stata replications.

Using replicateEverything

These functions are for readers and replicators: you have a DOI (or a registry handle), you want to see what is available, run it, and read the scripts.

Find a paper in the registry

Start with the index. load_index() returns registry index.csv as a data frame (DOI, title, journal, year, authors, study repo).

idx <- load_index()
head(idx[, c("doi", "title", "year")])

Example output:

#>                              doi                                    title year
#> 1 10.1177/00491241211036161   Bounding Causes of Effects with Randomized... 2022
#> 2 10.1017/S0003055403000534   Ethnicity, Insurgency, and Civil War        2003

search_papers() keyword-searches titles and authors.

search_papers("insurgency")

Example output:

#>                              doi                                  title
#> 1 10.1017/S0003055403000534 Ethnicity, Insurgency, and Civil War

For a resolved study handle (metadata loaded once), use get_study(). The return value is a compact replicate_study object — not only for printing.

st <- get_study("10.1017/S0003055403000534")  # Fearon & Laitin
summary(st)
# or: summary_study("10.1017/S0003055403000534")

# Inspect fields / filter programmatically
st$doi
st$languages
st$step_counts
st$related

# Pass DOI / handle strings into other verbs (they take character keys)
list_replications(st$doi)
describe_study_dag(st$doi)

# Other registry keys
get_study("10.1017/S0003055422000284")  # Blair et al. APSR
get_study("10.1257/aer.91.5.1369")       # Acemoglu et al. AER
get_study("rep-template")               # handle-only template

For one paper, list_replications() lists every registered table and figure, including engine (r / stata) when declared.

list_replications("10.1177/00491241211036161")
list_replications("10.1017/S0003055422000284")

Working on a study repo you have checked out locally? Every consumer verb (list_replications(), run_replication(), get_code(), describe_study_dag()) accepts doi = "local" in place of a DOI. setwd() into the study repo (or open its RStudio project) and use "local" — no registry lookup or DOI is needed:

setwd("path/to/rep-my-study")
list_replications("local")

Example output (abbreviated):

#> [[1]]
#> $id
#> [1] "fig_1"
#> $type
#> [1] "figure"

list_replications(..., grouped = TRUE) returns one entry per logical group. When both R and Stata exist for the same table, the default is R.

list_replications("10.1257/aer.91.5.1369", grouped = TRUE)
list_replications("10.1257/aer.91.5.1369", grouped = TRUE, language = "stata")

Pipeline steps (transforms) are listed separately:

list_replications("10.1017/s0003055426101749", include = "pipeline")

Run a replication

run_replication() is the main entry point. Pass a DOI (or registry handle) and a replication id ("fig_1", "tab_1", and so on). By default you get the analysis object — a ggplot, model, or data.frame. Pass format = TRUE for display-ready HTML or a formatted plot.

run_replication("10.1177/00491241211036161", "fig_1")

run_replication("10.1017/S0003055403000534", "tab_1", format = TRUE)

# Blair et al. / Acemoglu et al. when both engines or Dataverse wiring matter:
run_replication("10.1017/S0003055422000284", "tab_1")
run_replication("10.1257/aer.91.5.1369", "tab_1", language = "stata", format = TRUE)

To reproduce an entire paper, set what = "everything". The function runs every logical replication group (R by default where both engines exist).

run_replication("10.1177/00491241211036161", "everything")

View the replication code

get_code() returns the script behind a replication — R source or merged Stata .do files. Use it when you want to see how a result was produced, not only the output. The bundled Shiny app shows the same text on its Code tab.

cat(get_code("10.1177/00491241211036161", "fig_1"), sep = "\n")
cat(get_code("10.1017/S0003055403000534", "tab_1", language = "stata"), sep = "\n")

describe_study_dag() prints pipeline paths for a study (useful smoke check before Run):

describe_study_dag("10.1017/S0003055403000534")
describe_study_dag("10.1017/S0003055422000284")

Browse interactively in Shiny

The Shiny app is the consumer interface in a browser: pick a paper, switch between tables and figures, run replications, and copy the run_replication() call.

run_shiny_app() launches the bundled app from the installed package.

save_local_shiny() copies app.R and assets into a directory for Shiny Server (it never overwrites an existing local.R).

save_local_shiny("/srv/shiny/replicate")

See vignette("shiny-app", package = "replicateEverything") for deployment details. A live demo runs at shiny2.wzb.eu/ipi/replicate/.

Ready to contribute to replicateEverything?

These functions split contributors (authors preparing a study repo) from maintainers (registry operators syncing stubs and auditing the fleet).

When you work inside a monorepo checkout (sibling registry/ and rep-* study folders), point the package at local paths before calling discovery or run functions:

options(
  replicateEverything.registry_root = "/path/to/replicate_everything/registry",
  replicateEverything.study_folders_root = "/path/to/replicate_everything",
  replicateEverything.use_sibling_packages = TRUE
)

Without these options the package reads the public registry from GitHub and clones study materials on demand.

Maintainer setup (dependencies)

Live Run and Shiny probe dependencies only. Maintainers install once with:

check_study_compatibility("10.1017/S0003055426101749")
install_dependencies("10.1017/S0003055426101749")  # folder or package DOI
install_dependencies("everywhere")                  # every study in the registry

Build display outputs with [build_study_outputs()]. Full details: vignette("maintainer-setup").

Folder-backed studies (contributor)

Study repos hold replication.yml, code/, data/, and outputs/. See vignette("folder-replication-checklist").

[build_study_outputs()] runs every replication and writes display files under outputs/ plus outputs/manifest.json.

build_study_outputs(".", install_deps = TRUE)

[check_replication()] runs a transparent checklist: layout, yaml, outputs, tests, and optional live runs.

check_replication(".", full_replication = FALSE)

check_and_bake_study() runs the same checklist and (optionally) bakes outputs/ first — the single contributor entrypoint. It writes nothing into the study repo or a registry; it only validates.

Before running the full checklist, a manual smoke check with "local" is a fast way to confirm the study resolves and runs — no registry required:

list_replications("local")
describe_study_dag("local")
run_replication("local", "tab_1")  # one light step

check_and_bake_study(".", build_artifacts = TRUE)

Registry sync (maintainer)

There is no study-local registry handoff. A maintainer with a local registry checkout writes the stub directly from the study’s replication.yml:

options(replicateEverything.registry_root = "../registry")
sync_study_to_registry("../rep-10.1177-00491241211036161")
refresh_registry("../registry", audit = TRUE)

register_study() runs check_and_bake_study() then sync_study_to_registry() in one call:

register_study("../rep-10.1177-00491241211036161", registry_root = "../registry")

See vignette("maintainer-setup") for the full maintainer workflow.

Check precomputed outputs

[validate_outputs()] checks that declared table and figure files exist on disk (for Shiny Display). It does not run live replications.

validate_outputs(location = "../rep-10.1177-00491241211036161")
validate_outputs("10.1177/00491241211036161", what = "everything")
options(replicateEverything.registry_root = "../registry")
validate_outputs(doi = "everywhere", what = "everything")

Package-backed studies (contributor)

Package-backed studies must not define or ship run_replication(), list_replications(), load_artifact(), or get_code() — those verbs live only in replicateEverything. Study packages export pure make_*() / format_*() analysis helpers named in yaml. Validate with [check_replication()] (or [check_and_bake_study()]), then a maintainer syncs the stub with sync_study_to_registry() — no inst/registry/ handoff files.

check_replication("../rep-10.1371-journal.pone.0278337")
check_replication("../rep-10.1371-journal.pone.0278337", full_replication = TRUE)

See vignette("package-replication-checklist") for layout and API requirements.

Registry audit

audit_everything() attempts every table and figure in the registry (all engines), with a per-object time limit. Use it to check registry health after changes. Restrict with dois = or collections = (e.g. "APSR"); subset runs upsert into audit_jobs.csv and rebuild the portfolio health-bar summary (they do not wipe other studies).

audit <- audit_everything(patience = 20, dois = "10.1177/00491241211036161")
# audit <- audit_everything(patience = 20, collections = "APSR")
print(audit)

Example summary line:

#> Studies: 1 | Runs: 4 | OK: 4 | Failed: 0 | Timed out: 0

See vignette("audit") for the latest snapshot table shipped with the package.

Quick reference

Task Function
Consumer
Use the study in the cwd (no registry) doi = "local" (e.g. list_replications("local"))
Browse registry load_index(), search_papers()
Study overview summary(get_study(doi)), summary_study(doi)
What can I replicate? list_replications(), list_replications(..., grouped = TRUE)
Run one result run_replication()
Run whole paper run_replication(doi, "everything")
View code get_code()
Interactive browser run_shiny_app(), save_local_shiny()
Contributor
Check machine vs study yaml check_study_compatibility()
Install deps (one study) install_dependencies()
Install deps (all studies) install_dependencies("everywhere")
Build study outputs build_study_outputs()
Validate (+ optional bake) check_and_bake_study()
Validate study (checklist only) check_replication()
Check precomputed outputs validate_outputs()
Maintainer
Validate then sync in one call register_study()
Sync study into registry sync_study_to_registry()
Rebuild index + audit all refresh_registry()
Rebuild index only build_registry_index()
Registry output check validate_outputs(doi = "everywhere", what = "everything")
Registry health check audit_everything()
Seed audit jobs CSV (no live runs) seed_registry_audit_jobs()
Rebuild audit summary from CSV refresh_registry_audit_summary()