I am working on a vignette for an R package where I want to show how to do the same thing in two R packages. My preferred approach would be to include several tables, where I can show the appropriate code next to each other, something like so:
I don't care about the exact fonts, but I would like to see the R code laid out nicely and clearly, like it would be in a regular rmarkdown chunk, but then in a cell of a table.
Is there a way to achieve something like this in rmarkdown?
(I imagine it can by done by typing html directly, but that would be very cumbersome because I don't know html very well.)
If I understand your question correctly, you just want the R code to be able to be displayed in Rmarkdown?
This allows you to show your code in an R chunk
If you want to show your entire code you could do this
Which actually renders your r code as markdown code