Last active
August 29, 2015 14:25
-
-
Save jrnold/7cdd11321f3d13de3146 to your computer and use it in GitHub Desktop.
Knitr engine for printing a file
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
eng_printfile <- function(options) { | |
code <- paste(readLines(options$engine.opts$file), collapse = "\n") | |
options$engine <- options$engine.opts$lang | |
knitr::engine_output(options, code, '') | |
} | |
knitr::knit_engines$set(printfile = eng_printfile) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment