Skip to content
Browse files

add Rscript to knitr engines: http://stackoverflow.com/q/15271406/559676

  • Loading branch information...
1 parent 29b3d66 commit a373964ce06a87cecd0008853bb097ed9c3290ac @yihui committed Mar 7, 2013
Showing with 3 additions and 1 deletion.
  1. +3 −1 R/engine.R
View
4 R/engine.R
@@ -32,6 +32,7 @@ engine_output = function(options, code, out, extra = NULL) {
if (length(out) != 1L) out = str_c(out, collapse = '\n')
code = str_replace(code, '([^\n]+)$', '\\1\n')
out = str_replace(out, '([^\n]+)$', '\\1\n')
+ if (options$engine == 'Rscript') options$engine = 'r'
txt = paste(c(
if (options$echo) knit_hooks$get('source')(code, options),
if (options$results != 'hide' && !is_blank(out)) {
@@ -164,7 +165,8 @@ eng_coffee = function(options) {
}
# set engines for interpreted languages
-for (i in c('awk', 'bash', 'gawk', 'haskell', 'perl', 'python', 'ruby', 'sed', 'sh', 'zsh')) {
+for (i in c('awk', 'bash', 'gawk', 'haskell', 'perl', 'python', 'Rscript',
+ 'ruby', 'sed', 'sh', 'zsh')) {
knit_engines$set(setNames(list(eng_interpreted), i))
}
# additional engines

0 comments on commit a373964

Please sign in to comment.
Something went wrong with that request. Please try again.