From 27a9daaf3b94c23b437d55c5d1e3d282139ced22 Mon Sep 17 00:00:00 2001 From: "Rainer M. Krug" Date: Wed, 26 Mar 2014 17:09:15 +0100 Subject: [PATCH 3/8] Change R environment name from org to org_variables_ --- lisp/ob-R.el | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lisp/ob-R.el b/lisp/ob-R.el index af90e68..b51e582 100644 --- a/lisp/ob-R.el +++ b/lisp/ob-R.el @@ -103,12 +103,12 @@ this variable.") (append (when (cdr (assoc :prologue params)) (list (cdr (assoc :prologue params)))) - '("try(detach(org), silent=TRUE)") - '("org <- new.env()") + '("try(detach(org_variables_), silent=TRUE)") + '("org_variables_ <- new.env()") (org-babel-variable-assignments:R params) - '("lockEnvironment(org)") - '("attach(org)") - '("save(org, file='orgVARIABLES.RData')") + '("lockEnvironment(org_variables_)") + '("attach(org_variables_)") + '("save(org_variables_, file='org_variables.RData')") (list body) (when (cdr (assoc :epilogue params)) (list (cdr (assoc :epilogue params))))))) @@ -208,9 +208,9 @@ This function is called by `org-babel-execute-src-block'." "TRUE" "FALSE")) (row-names (if rownames-p "1" "NULL"))) (if (= max min) - (format "assign( '%s', read.table(\"%s\", header=%s, row.names=%s, sep=\"\\t\", as.is=TRUE ), envir = org ); lockBinding('%s', org)" name file header row-names name) - (format "assign( '%s', read.table(\"%s\", header=%s, row.names=%s, sep=\"\\t\", as.is=TRUE, fill=TRUE, col.names = paste(\"V\", seq_len(%d), sep =\"\") ), envir = org ); lockBinding('%s', org)" name file header row-names max name)))) - (format "assign('%s', %s, envir = org); lockBinding('%s', org)" name (org-babel-R-quote-tsv-field value) name))) + (format "assign( '%s', read.table(\"%s\", header=%s, row.names=%s, sep=\"\\t\", as.is=TRUE ), envir = org_variables_ ); lockBinding('%s', org_variables_)" name file header row-names name) + (format "assign( '%s', read.table(\"%s\", header=%s, row.names=%s, sep=\"\\t\", as.is=TRUE, fill=TRUE, col.names = paste(\"V\", seq_len(%d), sep =\"\") ), envir = org_variables_ ); lockBinding('%s', org_variables_)" name file header row-names max name)))) + (format "assign('%s', %s, envir = org_variables_); lockBinding('%s', org_variables_)" name (org-babel-R-quote-tsv-field value) name))) (defvar ess-ask-for-ess-directory) ; dynamically scoped (defun org-babel-R-initiate-session (session params) -- 1.8.5.2 (Apple Git-48)