reprex
Render bits of R code for sharing, e.g., on GitHub or StackOverflow
reprex is an R package (from the tidyverse / Posit ecosystem) that helps users make reproducible examples (reprexes) of R code: self-contained, shareable, minimal examples capturing an issue or showing desired behavior. It formats code and its output nicely (often using Markdown or syntax appropriate to posting on forums, GitHub, StackOverflow etc.), handles dependencies, session info, etc. The goal is to make debugging, asking for help, or demonstrating code easier through rigorous reproducible examples. Get slightly different Markdown, optimized for Slack messages. Handles dependencies (e.g. load required libraries inside the reprex) so that code example is self-contained. Captures session information (R version, package versions etc.) so that context is preserved when sharing.