| name | r-reproducibility-guide |
| description | Create reproducible research workflows with R and RMarkdown/Quarto |
| metadata | {"openclaw":{"emoji":"🔁","category":"tools","subcategory":"code-exec","keywords":["R programming","RMarkdown","reproducibility","Quarto","renv","computational reproducibility"],"source":"wentor-research-plugins"}} |
Reproducible Research with R
A skill for creating fully reproducible research workflows in R using RMarkdown, Quarto, package management with renv, and project organization best practices. Covers literate programming, environment management, automated reporting, and sharing reproducible analyses.
Project Organization
Recommended Directory Structure
my-research-project/
README.md
my-project.Rproj # RStudio project file
renv.lock # Package versions (managed by renv)
renv/ # renv library directory
data/
raw/ # Untouched original data
processed/ # Cleaned, analysis-ready data
R/
01-clean.R # Data cleaning functions
02-analyze.R # Analysis functions
03-visualize.R # Plotting functions
utils.R # Helper functions
analysis/
main-analysis.Rmd # Primary analysis notebook
supplementary.Rmd # Supplementary analyses
output/
figures/ # Generated plots
tables/ # Generated tables
manuscript.pdf # Compiled document
Makefile # Reproducible build commands
Key Principles
1. Raw data is read-only (never modify original data files)
2. All processing steps are scripted (no manual spreadsheet edits)
3. Generated outputs can be deleted and recreated from source
4. Package versions are locked with renv
5. Random seeds are set for all stochastic operations
6. Paths are relative to project root (never absolute)