Closed multimeric closed 11 months ago
I think this is a duplicated of
Will track this in there if you're ok.
Duplicate of #2041
This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary.
This question has been asked many times on StackOverflow:
In each case, the best or only solution is to use a hack like converting Rmd to R using
knitr::purl
, and then convert back to a chunk usingknitr::read_chunk
. This doesn't seem like an ideal solution, because firstly we're doing all this redundant conversion when we already have the chunk in the right format, it's just in the wrong place. Secondly, it requires the use of temporary files which it ideally would not, especially because we have to clean them up.I wonder if we could simply have a function like
knitr::read_rmd_chunk(file="foo.Rmd", chunk_name="bar-chunk")
that would act likeknitr::read_chunk
in that it registers the chunk for use?By filing an issue to this repo, I promise that
xfun::session_info('knitr')
. I have upgraded all my packages to their latest versions (e.g., R, RStudio, and R packages), and also tried the development version:remotes::install_github('yihui/knitr')
.I understand that my issue may be closed if I don't fulfill my promises.