From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rainer M Krug Subject: Re: [PATCH] read.table in variable transfer caused sometimes "function not found" error - small change Date: Wed, 08 Oct 2014 20:39:41 +0200 Message-ID: References: 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]:38487) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xbw9W-0000EK-31 for emacs-orgmode@gnu.org; Wed, 08 Oct 2014 14:40:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xbw9P-0006o3-Jc for emacs-orgmode@gnu.org; Wed, 08 Oct 2014 14:39:58 -0400 Received: from mail-wi0-f169.google.com ([209.85.212.169]:53923) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xbw9P-0006nz-Eb for emacs-orgmode@gnu.org; Wed, 08 Oct 2014 14:39:51 -0400 Received: by mail-wi0-f169.google.com with SMTP id cc10so12859237wib.4 for ; Wed, 08 Oct 2014 11:39:50 -0700 (PDT) In-Reply-To: (Charles C. Berry's message of "Wed, 8 Oct 2014 08:43:47 -0700") 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: "Charles C. Berry" Cc: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable "Charles C. Berry" writes: > On Wed, 8 Oct 2014, Rainer M Krug wrote: > >> "Charles C. Berry" writes: >> >>> On Mon, 6 Oct 2014, Rainer M Krug wrote: >>> >>>> 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 pack= age >>>> name to the call in R, i.e. replacing =3Dread.table()=3D with >>>> =3Dutils::read.table()=3D which is done in this patch. >>> >>> It does fix that one case. >>> >>> But I wonder if that is the best way. >>> >>> The heart of the matter is that load_all eventually calls sys.source, >>> which can be persnickety about finding objects on the search path. See >>> ?sys.source. >>> >>> If the src block you tangle to ./data/ has any code that uses any >>> other objects from utils, stats, datasets or whatever, you will be in >>> the same pickle. >> >> Exactly - that is true. But it is the same when putting this in a >> package (as far as I am aware). >> > > Do you mean that putting `x <- rnorm(10)' into a data/*.R file will > fail when you try to build and check? > > In fact, `R CMD build' will execute it and save the result as a > data/*.rda file. And check will go through. > > devtools::load_all (calling load_data) fails to do that. Which is why > I think this is a devtools issue. OK - point taken. But I still think that the =3Dutils::read.table()=3D would not hurt, rather make the variable transfer safer. Rainer > > Chuck > > =2D-=20 Rainer M. Krug email: Rainerkrugsde PGP: 0x0F52F982 --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) iQEcBAEBAgAGBQJUNYTyAAoJENvXNx4PUvmCnO0H/j0ezuHE/lyS0X5CYedOsNUG iw3SQcpsyZrnqpfgDKxqeJJG1tTgYAZYr0iorYU0x54E/kN6SItHvNi93dbecYM8 smNUEKNXH88z0AsDhR2oBl/GUI2H2OQzbybn46LlmmaGGcDGpJfk/3LzWGxGsMzq bKYNTIQk5AW98/n9VfvD9v/oNzLFCsdHEIb5/MiiSYZA5la1TjWptDYo2BnacFwG jk/PR0PKHKkZVngQ/ljgE/xupDTsgBzwclDWZTeDnGUlTI0FOAkDRYDeRtDcZd3U 2/oN0fABPcQlwV/67ckX/0oVtje4Mghk8b76wAWyxYuPb3//2uXOxtrUaJyLbN0= =/QzH -----END PGP SIGNATURE----- --=-=-=--