Workflow leaderboard / Research / Data analysis
Create a reproducible R and Python analysis environment
创建可复现的 R 与 Python 分析环境
Run R and Python in one locked project, render a single analysis report and archive the environment and input hashes.
Variants
Free & local / 免费本地
~35 min setup
Any 16 GB laptop is suitable for ordinary tabular analysis. Large datasets may require more memory.
| Component | Role | Price | Link |
|---|---|---|---|
| Pixi 0.75.0 | cross-language dependency resolution and lockfile | Free / 免费BSD-3-Clause package managerchecked 2026-08-02 | https://github.com/prefix-dev/pixi/releases/tag/v0.75.0 |
| Quarto 1.10.18 | render one report containing R and Python outputs | Free / 免费GPL-2.0 open-source publishing systemchecked 2026-08-02 | https://github.com/quarto-dev/quarto-cli/releases/tag/v1.10.18 |
Save as pixi.toml
[workspace]
name = "mixed-analysis"
channels = ["conda-forge"]
platforms = ["linux-64", "win-64", "osx-arm64"]
[dependencies]
python = "3.12.*"
r-base = "4.5.*"
pandas = "*"
r-dplyr = "*"
r-ggplot2 = "*"
quarto = "1.10.*"
jupyter = "*"
[tasks]
render = "quarto render"
versions = "python --version && R --version && quarto --version"
Lock, render and archive
pixi install
pixi run versions > environment-versions.txt
pixi run render
sha256sum data/input.csv > input-SHA256SUMS
pixi lock
tar -czf reproducibility-bundle.tgz pixi.toml pixi.lock analysis.qmd _quarto.yml environment-versions.txt input-SHA256SUMS _site
Analysis contract
inputs:
immutable: true
checksums_required: true
randomness:
python_seed: 20260802
r_seed: 20260802
outputs:
generated_only_by_render: true
review:
- missing_value_policy
- exclusion_counts
- units_and_labels
- session_versions
- clean_environment_rerun
Known pitfalls
- A lockfile does not capture system drivers, external services or restricted data.
- Do not edit derived tables or figures by hand.
- Cross-platform lock resolution does not guarantee bit-identical numerical output.
- Record seeds, locale and input hashes in addition to package versions.