From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rainer M Krug Subject: [PATCH] read.table in variable transfer caused sometimes "function not found" error - small change Date: Mon, 06 Oct 2014 14:00:50 +0200 Message-ID: Mime-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46042) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xb6ya-0007MV-V6 for emacs-orgmode@gnu.org; Mon, 06 Oct 2014 08:01:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xb6yS-0001dj-79 for emacs-orgmode@gnu.org; Mon, 06 Oct 2014 08:01:16 -0400 Received: from plane.gmane.org ([80.91.229.3]:45358) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xb6yS-0001db-0c for emacs-orgmode@gnu.org; Mon, 06 Oct 2014 08:01:08 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Xb6yR-0007aD-Cj for emacs-orgmode@gnu.org; Mon, 06 Oct 2014 14:01:07 +0200 Received: from arn78-1-88-186-171-7.fbx.proxad.net ([88.186.171.7]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 06 Oct 2014 14:01:07 +0200 Received: from R.M.Krug by arn78-1-88-186-171-7.fbx.proxad.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 06 Oct 2014 14:01:07 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain 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 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-ob-R.el-Add-package-name-to-read.table-call.patch Content-Transfer-Encoding: quoted-printable Content-Description: Patch From=207e43b724d9fd2557aef7440bb75de0e026a29c88 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. =2D-- 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 =2D-- a/lisp/ob-R.el +++ b/lisp/ob-R.el @@ -101,7 +101,7 @@ this variable.") con <- textConnection( %S ) =2D res <- read.table( + res <- utils::read.table( con, header =3D %s, row.names =3D %s, @@ -119,7 +119,7 @@ This function is used when the table contains a header.= ") con <- textConnection( %S ) =2D res <- read.table( + res <- utils::read.table( con, header =3D %s, row.names =3D %s, =2D-=20 2.1.2 --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable =2D-=20 Rainer M. Krug email: Rainerkrugsde PGP: 0x0F52F982 --=-=-=-- --==-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) iQEcBAEBAgAGBQJUMoR2AAoJENvXNx4PUvmCC6cIAJxbxPo7Ca1T/HBD3D/IQg8k RcA4vizG9qk79tRTE4KyHVOLaqYJ/4N5A7v2PhEBiGvJIe8Sr+wm1Sgipayb/5NW zX7yzHU8z7cOcget3P2MJ2ZydqqnMuc4RuPBd2hmLNrjxR01H4oXFY54rYKmiyh/ YgxxpZfjVbMciVLGsS7JQ2zNQzCi+bVIUrEJtJElWnqAmQ4daCUPBWwuorU1V077 iBTB4jpEOyf6oLAGQ0uCpxqf7S5v8XPxEapTx5mKne56RkR3bfFmoNy+XXHlPFiw vTz8nau9QqTzPh5yAF9zjVkaRrp4ivAW/OrhDPXzLNwCR2f7UZWNhQs6rZBz1tI= =yN2M -----END PGP SIGNATURE----- --==-=-=--