Browse Source

ob-R: Don't handle errors in R; expose to Org-babel error handling.

* lisp/ob-R.el (org-babel-R-write-object-command): Force evaluation of
user code prior to the R exception-handling, so that errors in user
code are unhandled.
Dan Davison 10 years ago
parent
commit
f7bca4ed1a
1 changed files with 2 additions and 1 deletions
  1. 2 1
      lisp/ob-R.el

+ 2 - 1
lisp/ob-R.el

@@ -221,7 +221,8 @@ current code buffer."
 
 (defvar org-babel-R-eoe-indicator "'org_babel_R_eoe'")
 (defvar org-babel-R-eoe-output "[1] \"org_babel_R_eoe\"")
-(defvar org-babel-R-write-object-command "{function(object, transfer.file) {invisible(if(inherits(try(write.table(object, file=transfer.file, sep=\"\\t\", na=\"nil\",row.names=%s, col.names=%s, quote=FALSE), silent=TRUE),\"try-error\")) {if(!file.exists(transfer.file)) file.create(transfer.file)})}}(object=%s, transfer.file=\"%s\")")
+
+(defvar org-babel-R-write-object-command "{function(object, transfer.file) {object;invisible(if(inherits(try(write.table(object, file=transfer.file, sep=\"\\t\", na=\"nil\",row.names=%s, col.names=%s, quote=FALSE), silent=TRUE),\"try-error\")) {if(!file.exists(transfer.file)) file.create(transfer.file)})}}(object=%s, transfer.file=\"%s\")")
 
 (defun org-babel-R-evaluate
   (session body result-type column-names-p row-names-p)