Skip to content

Instantly share code, notes, and snippets.

@tonyelhabr
Created December 18, 2025 19:58
Show Gist options
  • Select an option

  • Save tonyelhabr/9d0545bb32bd8f81d44c9a760c7fc04e to your computer and use it in GitHub Desktop.

Select an option

Save tonyelhabr/9d0545bb32bd8f81d44c9a760c7fc04e to your computer and use it in GitHub Desktop.
Print R dataframe like a reprex
reprex_print <- function(...) {
capture.output(...) |>
paste('#>', x = _) |>
cat(sep = '\n')
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment