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

Prof Brian Ripley ripley at stats.ox.ac.uk
Tue May 21 18:03:29 CEST 2013


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



More information about the R-devel mailing list