emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] read.table in variable transfer caused sometimes "function not found" error - small change
@ 2014-10-06 12:00 Rainer M Krug
  2014-10-07 20:51 ` Charles C. Berry
  0 siblings, 1 reply; 10+ messages in thread
From: Rainer M Krug @ 2014-10-06 12:00 UTC (permalink / raw)
  To: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 551 bytes --]

Hi

The variable transfer of tables from org to R caused sometimes 'could
not find function "read.table"' errors (e.g. when the file was tangled
into a ./data directory which was loaded by the function
devtools::load_all("./")). This can easily be fixed by adding the package
name to the call in R, i.e. replacing =read.table()= with
=utils::read.table()= which is done in this patch.

In R the calls read.table and utils::read.table are interchangeable (the
second one is actually preferred) so no negative effects can be
expected.

Cheers,

Rainer


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: Patch --]
[-- Type: text/x-patch, Size: 1139 bytes --]

From 7e43b724d9fd2557aef7440bb75de0e026a29c88 Mon Sep 17 00:00:00 2001
From: "Rainer M. Krug" <R.M.Krug@gmail.com>
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.
---
 lisp/ob-R.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lisp/ob-R.el b/lisp/ob-R.el
index ea33031..dd0b0b9 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,
@@ -119,7 +119,7 @@ This function is used when the table contains a header.")
      con <- textConnection(
        %S
      )
-     res <- read.table(
+     res <- utils::read.table(
        con,
        header    = %s,
        row.names = %s,
-- 
2.1.2


[-- Attachment #1.3: Type: text/plain, Size: 73 bytes --]



-- 
Rainer M. Krug
email: Rainer<at>krugs<dot>de
PGP: 0x0F52F982

[-- Attachment #2: Type: application/pgp-signature, Size: 494 bytes --]

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2014-10-10  7:44 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-06 12:00 [PATCH] read.table in variable transfer caused sometimes "function not found" error - small change Rainer M Krug
2014-10-07 20:51 ` Charles C. Berry
2014-10-08  9:54   ` Rainer M Krug
2014-10-08 15:43     ` Charles C. Berry
2014-10-08 18:39       ` Rainer M Krug
2014-10-08 21:34         ` Charles C. Berry
2014-10-09  8:19           ` [NEW PATCH] " Rainer M Krug
2014-10-09  8:25             ` Rainer M Krug
2014-10-10  4:21               ` Aaron Ecay
2014-10-10  7:43                 ` Rainer M Krug

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).