R functions as knitr chunks
In writing an R Markdown document to describe a within-host malaria model that I'm working on, I discovered that knitr::read_chunk() only accepts fixed line numbers and # ---- some-label marker comments.
So I've implemented read_function_chunks(), below, which extracts each top-level function as a separate chunk, and supports including roxygen documentation comments.