Site icon R-bloggers

(ICYMI) RPweave: Unified R + Python + LaTeX System using uv

[This article was first published on T. Moudiki's Webpage - R, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

ICYMI: RPweave — Unified R + Python + LaTeX Workflow (Powered by uv)

If you juggle R, Python, and LaTeX for research, you know the pain: fragmented scripts, mixed environments, manual copying, and fragile reproducibility.

I needed a setup/workflow that handles both languages, any LaTeX template, environment isolation, and a command-line–first workflow — so I assembled RPweave. Not a new idea, but a polished, modern take that just works.

RPweave (GitHub template here: https://github.com/Techtonique/RPweave) ties everything together using:


Getting Started

The workflow starts by cloning the RPweave template repo, and listing the Python packages you need in requirements.txt. Then, set up the isolated environment and install R dependencies via make setup. Finally, write your .Rnw document mixing R and Python chunks, and build with make view.

git clone https://github.com/Techtonique/RPweave my-paper
cd my-paper
uv venv venv && source venv/bin/activate
make setup
make view

Why It Matters

RPweave lets you:


Minimal Example

The first chunk is mandatory.

<<setup>>=
library(knitr); library(reticulate)
use_python("venv/bin/python")
@

<<r-analysis>>=
ggplot(mtcars, aes(wt, mpg)) + geom_point()
@

<<python-analysis, engine='python'>>=
import pandas as pd
print(pd.DataFrame({'x': range(100)}).describe())
@

Ideal For


Pro Tips


Repo & Docs

To leave a comment for the author, please follow the link and comment on their blog: T. Moudiki's Webpage - R.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
Exit mobile version