Re: [Rd] no visible binding for global variable for data sets in a package

2014-08-28 Thread Martin Maechler
peter dalgaard pda...@gmail.com on Wed, 27 Aug 2014 21:09:47 +0200 writes: On 27 Aug 2014, at 16:48 , Hadley Wickham h.wick...@gmail.com wrote: I think the right answer _is_ to export the lazy data; the question is how to do it. There's nothing particularly strange about

Re: [Rd] no visible binding for global variable for data sets in a package

2014-08-28 Thread Therneau, Terry M., Ph.D.
Here is one rationale for the change, which was useful for my understanding This arises in the survival package in the survexp function: survexp - function(formula, data, weights, subset, na.action, ratetable=survexp.us) The argument has been changed to survival::survexp.us, soon to be

Re: [Rd] no visible binding for global variable for data sets in a package

2014-08-27 Thread Martin Maechler
Michael Friendly frien...@yorku.ca on Tue, 26 Aug 2014 17:58:34 -0400 writes: I'm updating the Lahman package of baseball statistics to the 2013 release. In addition to the main data sets, the package also contains several convenience functions that make use of

Re: [Rd] no visible binding for global variable for data sets in a package

2014-08-27 Thread peter dalgaard
The change would seem to be this \item \command{R CMD check} now by default checks code usage directly on the package namespace without loading and attaching the package and its suggests and enhances. and perhaps the remedies could be stated more clearly? Putting the data

Re: [Rd] no visible binding for global variable for data sets in a package

2014-08-27 Thread Joshua Wiley
I have had similar notes, but in cases where the dataset was created internally by a function: * checking R code for possible problems ... NOTE vm_diagnostics: no visible binding for global variable 'Median' vm_diagnostics: no visible binding for global variable 'Index' vm_diagnostics: no visible

Re: [Rd] no visible binding for global variable for data sets in a package

2014-08-27 Thread John Maindonald
Re solution 2, the following is in the function tabFarsDead() the latest (0.55) version of gamclass: data('FARS', package='gamclass', envir=environment()) FARS - get(FARS, envir=environment()) The second statement is, strictly, redundant, but it makes the syntax checker happy. Another

Re: [Rd] no visible binding for global variable for data sets in a package

2014-08-27 Thread Michael Friendly
On 8/27/2014 5:24 AM, Martin Maechler wrote: Michael Friendly frien...@yorku.ca on Tue, 26 Aug 2014 17:58:34 -0400 writes: I'm updating the Lahman package of baseball statistics to the 2013 release. In addition to the main data sets, the package also contains several

Re: [Rd] no visible binding for global variable for data sets in a package

2014-08-27 Thread Michael Friendly
On 8/27/2014 9:29 AM, Michael Friendly wrote: It works in the sense that Lahman::Label(yearID) will work even when Lahman is not in the search path, but R-devel CMD check will still give the same NOTE, though you can argue that that note is actally a false positive. So, this would be

Re: [Rd] no visible binding for global variable for data sets in a package

2014-08-27 Thread peter dalgaard
Using data() in a package with lazyloaded data seems like asking for trouble to me. But you're making me curious (and I'm too lazy[*] to set up for rebuilding the package myself): Did you actually try putting battingLabels friends in the namespace? What happened? A workaround could be to use

Re: [Rd] no visible binding for global variable for data sets in a package

2014-08-27 Thread Hadley Wickham
I think the right answer _is_ to export the lazy data; the question is how to do it. There's nothing particularly strange about exporting non-functions (letters would be an example, save for the special status of package:base). If you attach the package, the lazyloaded data appear in the

Re: [Rd] no visible binding for global variable for data sets in a package

2014-08-27 Thread Prof Brian Ripley
http://cran.r-project.org/doc/manuals/r-patched/R-exts.html#Suggested-packages suggests e.g. Lahman::battingLabels, and that does work for lazy-loaded datasets (which is what these appear to be). We have seen a couple of other instances in which this was needed for code within the package.

Re: [Rd] no visible binding for global variable for data sets in a package

2014-08-27 Thread Michael Friendly
On 8/27/2014 10:41 AM, peter dalgaard wrote: Using data() in a package with lazyloaded data seems like asking for trouble to me. But you're making me curious (and I'm too lazy[*] to set up for rebuilding the package myself): Did you actually try putting battingLabels friends in the

Re: [Rd] no visible binding for global variable for data sets in a package

2014-08-27 Thread Hadley Wickham
On Wed, Aug 27, 2014 at 12:51 PM, Michael Friendly frien...@yorku.ca wrote: On 8/27/2014 10:41 AM, peter dalgaard wrote: Using data() in a package with lazyloaded data seems like asking for trouble to me. But you're making me curious (and I'm too lazy[*] to set up for rebuilding the package

Re: [Rd] no visible binding for global variable for data sets in a package

2014-08-27 Thread peter dalgaard
On 27 Aug 2014, at 19:51 , Michael Friendly frien...@yorku.ca wrote: - Peter Dalgaard noted the change in R-devel, and nobody so far has suggested a working remedy, so a clean solution seems warranted. Actually, both Peter Dalgaard and Brian Ripley suggested Lahman:battingLabels, and,

Re: [Rd] no visible binding for global variable for data sets in a package

2014-08-27 Thread peter dalgaard
On 27 Aug 2014, at 16:48 , Hadley Wickham h.wick...@gmail.com wrote: I think the right answer _is_ to export the lazy data; the question is how to do it. There's nothing particularly strange about exporting non-functions (letters would be an example, save for the special status of

[Rd] no visible binding for global variable for data sets in a package

2014-08-26 Thread Michael Friendly
I'm updating the Lahman package of baseball statistics to the 2013 release. In addition to the main data sets, the package also contains several convenience functions that make use of these data sets. These now trigger the notes below from R CMD check run with Win builder, R-devel. How can I