Created
November 22, 2021 11:59
-
-
Save edonnachie/8d3254e1727f723972b7a980e1da6518 to your computer and use it in GitHub Desktop.
Make chunks from one .Rmd document available to a different .Rmd document
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
read_chunk_Rmd <- function(path, ...) { | |
f_tmp <- tempfile() | |
knitr::purl(input = path, output = f_tmp) | |
on.exit(file.remove(f_tmp)) | |
knitr::read_chunk(f_tmp, ...) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Created