I cannot give an example, otherwise I would not ask this question at all. I love the reprex package for R. However, sometimes I write some simple R markdown code with I process with rmarkdown::render(). Is there a way I can use the reprex package on an R markdown file to generate a reproducible example which is easy to post, for instance, on this site?
Many thanks
You could use the
reprex_renderfunction fromreprexpackage to render.Ror.Rmdfiles.Here is a reproducible example:
Output viewer:
Example Rmarkdown file called
reprex_test.Rmd: