Include a chunk in a list RMarkdown
knitr, r, r-markdown
Solution
Are you looking for that? (Save the following code as Rmd file)
---
title: "Untitled"
output: html_document
---
1. Something about some code - you could try this_fun.
1. A more complicated way is to do
{r, eval = FALSE} a <- function() { # whole chunk indented by 4! return(2) } print(a())
And that may suit your use case
1. Skip it all together
`
It look like that:
Problem
How do you get rmarkdown to include a code chunk as part of a list? Example: - Something about some code - you could try `this_fun` - A more complicated way is to do ```{r, eval = FALSE} a( large( nested(function))) ``` And that may suit your use case - Skip it all together Originally I was using the vanilla ``` code chunk, but that gives up syntax highlighting, and inline gives up highlighting and newlines/indentation. If the code is used as above the list is broken, and the text following the chunk becomes embedded in a weird environment (something like the output formatting). Anyone know if this can be done?