From 58cb8521d4d4b620b0c5210a9b7232f99f7c720c Mon Sep 17 00:00:00 2001 From: "Rainer M. Krug" Date: Mon, 6 Oct 2014 13:48:49 +0200 Subject: [PATCH] ob-R.el: Add package name to read.table call * lisp/ob-R.el: (ob-R-transfer-variable-table-with-header): Add package name to call of R function read.table (now utils::read.table). This clarifies the call as well as avoids 'could not find function' error in R under certain conditions. (ob-R-transfer-variable-table-without-header): Add package name to call of R function read.table (now utils::read.table). This clarifies the call as well as avoids 'could not find function' error in R under certain conditions. --- lisp/ob-R.el | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/lisp/ob-R.el b/lisp/ob-R.el index ea33031..0b24a64 100644 --- a/lisp/ob-R.el +++ b/lisp/ob-R.el @@ -101,7 +101,7 @@ this variable.") con <- textConnection( %S ) - res <- read.table( + res <- utils::read.table( con, header = %s, row.names = %s, @@ -112,14 +112,17 @@ this variable.") res })" "R code used to transfer a table defined as a variable from org to R. -This function is used when the table contains a header.") +This function is used when the table contains a header. The usage +of utils::read.table() ensures that the command read.table() can +be found even in circumstances when the utils package is not in +the search path from R.") (defconst ob-R-transfer-variable-table-without-header "%s <- local({ con <- textConnection( %S ) - res <- read.table( + res <- utils::read.table( con, header = %s, row.names = %s, @@ -132,7 +135,10 @@ This function is used when the table contains a header.") res })" "R code used to transfer a table defined as a variable from org to R. -This function is used when the table does not contain a header.") +This function is used when the table does not contain a +header. The usage of utils::read.table() ensures that the command +read.table() can be found even in circumstances when the utils +package is not in the search path from R.") (defun org-babel-expand-body:R (body params &optional graphics-file) "Expand BODY according to PARAMS, return the expanded body." -- 2.1.2