[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] [PATCH] read.table in variable transfer caused sometimes "functi
From: |
Rainer M Krug |
Subject: |
Re: [O] [PATCH] read.table in variable transfer caused sometimes "function not found" error - small change |
Date: |
Wed, 08 Oct 2014 20:39:41 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3 (darwin) |
"Charles C. Berry" <address@hidden> writes:
> On Wed, 8 Oct 2014, Rainer M Krug wrote:
>
>> "Charles C. Berry" <address@hidden> 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 package
>>>> name to the call in R, i.e. replacing =read.table()= with
>>>> =utils::read.table()= 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 =utils::read.table()= would
not hurt, rather make the variable transfer safer.
Rainer
>
> Chuck
>
>
--
Rainer M. Krug
email: Rainer<at>krugs<dot>de
PGP: 0x0F52F982
pgpfwAOySV18X.pgp
Description: PGP signature
- [O] [PATCH] read.table in variable transfer caused sometimes "function not found" error - small change, Rainer M Krug, 2014/10/06
- Re: [O] [PATCH] read.table in variable transfer caused sometimes "function not found" error - small change, Charles C. Berry, 2014/10/07
- Re: [O] [PATCH] read.table in variable transfer caused sometimes "function not found" error - small change, Rainer M Krug, 2014/10/08
- Re: [O] [PATCH] read.table in variable transfer caused sometimes "function not found" error - small change, Charles C. Berry, 2014/10/08
- Re: [O] [PATCH] read.table in variable transfer caused sometimes "function not found" error - small change,
Rainer M Krug <=
- Re: [O] [PATCH] read.table in variable transfer caused sometimes "function not found" error - small change, Charles C. Berry, 2014/10/08
- [O] [NEW PATCH] read.table in variable transfer caused sometimes "function not found" error - small change, Rainer M Krug, 2014/10/09
- Re: [O] [NEW PATCH] read.table in variable transfer caused sometimes "function not found" error - small change, Rainer M Krug, 2014/10/09
- Re: [O] [NEW PATCH] read.table in variable transfer caused sometimes "function not found" error - small change, Aaron Ecay, 2014/10/10
- Re: [O] [NEW PATCH] read.table in variable transfer caused sometimes "function not found" error - small change, Rainer M Krug, 2014/10/10