Guest User

Untitled

a guest
Oct 23rd, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. eng_cppheader = function(options)
  2. {
  3. opts = options$engine.opts
  4. code = paste(options$code, collapse = "n")
  5. if (is.null(opts$path)) opts$path = tempdir()
  6. cat(code, file = file.path(opts$path, opts$filename))
  7. Sys.setenv(PKG_CPPFLAGS = paste0("-I", opts$path))
  8. options$engine = 'cpp'
  9. engine_output(options, code, "")
  10. }
  11. knitr::knit_engines$set(cppheader=eng_cppheader)
Add Comment
Please, Sign In to add comment