From ripley at stats.ox.ac.uk  Tue May 21 18:03:29 2013
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Tue, 21 May 2013 17:03:29 +0100
Subject: [Rd] Objects created by more than one data call?
In-Reply-To: <519B97EA.2060003@prodsyse.com>
References: <519AADE9.2000505@structuremonitoring.com>
	<519B01D7.4060804@stats.ox.ac.uk> <519B848A.3020305@prodsyse.com>
	<519B88FB.2020706@stats.ox.ac.uk> <519B97EA.2060003@prodsyse.com>
Message-ID: <519B9AD1.1000406@stats.ox.ac.uk>

On 21/05/2013 16:51, Spencer Graves wrote:
> On 5/21/2013 7:47 AM, Prof Brian Ripley wrote:
>> On 21/05/2013 15:28, Spencer Graves wrote:
>>> On 5/20/2013 10:10 PM, Prof Brian Ripley wrote:
>>>> On 21/05/2013 00:12, Spencer Graves wrote:
>>>>> Hello, All:
>>>>>
>>>>>
>>>>>        If I use LazyData with the Ecdat package on R-Forge, "R CMD
>>>>> check" reports "no visible binding for global variable
>>>>> 'nonEnglishNames'", where 'nonEnglishNames' is a dataset in Ecdat used
>>>>> as the default argument for a function.  With LazyData, that NOTE
>>>>> disappears.  However, then I get, "Warning: objects 'Hstarts',
>>>>> 'Hstarts', 'MedExp' are created by more than one data call".
>>>>>
>>>>>
>>>>>        What do you suggest I do to fix this problem?
>>>>
>>>> Not create the objects in more than one data() call.
>>>>
>>>> Check what each of your data() calls produces.
>>>
>>>
>>>        Thanks.  How do I do that?
>>
>> Call data() on each in turn, and see what files get added to an empty
>> workspace.
>
>
> Like the following?

You missed the 'empty'.  Look at tools:::data2LazyLoadDB to see how this 
is checked.

>
>
>  > library(Ecdat)
>  > objects()
> character(0)
>  > (data(Hstarts))
> [1] "Hstarts"
>  > (data(MedExp))
> [1] "MedExp"
>  > objects()
> [1] "Hstarts" "MedExp"
>  > sessionInfo()
> R version 3.0.0 (2013-04-03)
> Platform: i386-w64-mingw32/i386 (32-bit)
>
> locale:
> [1] LC_COLLATE=English_United States.1252
> [2] LC_CTYPE=English_United States.1252
> [3] LC_MONETARY=English_United States.1252
> [4] LC_NUMERIC=C
> [5] LC_TIME=English_United States.1252
>
> attached base packages:
> [1] stats     graphics  grDevices utils     datasets  methods base
>
> other attached packages:
> [1] Ecdat_0.2-3
>
> loaded via a namespace (and not attached):
> [1] tools_3.0.0
>
>
>        Thanks,
>        Spencer
>
>>
>>>        In the "man" directory, I just did "grep 'data(MedExp' *.Rd",
>>> which identified only "MedExp.Rd:\usage{data(MedExp)}";  "grep
>>> 'data(Hstarts *.Rd" similarly returned only
>>> "Hstarts.Rd:\usage(data(Hstarts)}".
>>>
>>>
>>>        Thanks again for the reply.
>>>        Spencer
>>>>
>>>>>
>>>>>        Thanks,
>>>>>        Spencer Graves
>>>>>
>>>>>
>>>>>  > sessionInfo()
>>>>> R version 3.0.0 (2013-04-03)
>>>>> Platform: i386-w64-mingw32/i386 (32-bit)
>>>>>
>>>>> locale:
>>>>> [1] LC_COLLATE=English_United States.1252
>>>>> [2] LC_CTYPE=English_United States.1252
>>>>> [3] LC_MONETARY=English_United States.1252
>>>>> [4] LC_NUMERIC=C
>>>>> [5] LC_TIME=English_United States.1252
>>>>>
>>>>> attached base packages:
>>>>> [1] stats     graphics  grDevices utils     datasets methods base
>>>>>
>>>>> other attached packages:
>>>>> [1] Ecdat_0.2-3
>>>>>
>>>>> loaded via a namespace (and not attached):
>>>>> [1] tools_3.0.0
>>>>>
>>>>> ______________________________________________
>>>>> R-devel at r-project.org mailing list
>>>>> https://stat.ethz.ch/mailman/listinfo/r-devel


-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



[Rd] Objects created by more than one data call?
Prof Brian Ripley