Re: [R] no visible binding for global variable and with() vs. within()

2014-08-22 Thread Martin Maechler
Rolf Turner r.tur...@auckland.ac.nz on Mon, 18 Aug 2014 08:47:36 +1200 writes: On 17/08/14 23:05, Duncan Murdoch wrote: On 16/08/2014, 9:36 PM, Daniel Braithwaite wrote: R CMD check does not object to this code when checking a package: foo1 - function (bar) {

Re: [R] no visible binding for global variable and with() vs. within()

2014-08-22 Thread Henrik Bengtsson
I'm dealing with these type of false NOTEs as: foo1 - function (bar) { # To please R CMD check x - NULL; rm(list=x) with(bar, { x }) } Of course, that may one day break with more clever code inspections. My $.02 /Henrik On Fri, Aug 22, 2014 at 2:40 AM, Martin Maechler

[R] no visible binding for global variable and with() vs. within()

2014-08-17 Thread Daniel Braithwaite
R CMD check does not object to this code when checking a package: foo1 - function (bar) { with(bar, { x }) } but produces a warning: foo2: no visible binding for global variable 'x' in response to this: foo2 - function (bar) { within(bar, { x }) } Is this an R bug, or

Re: [R] no visible binding for global variable and with() vs. within()

2014-08-17 Thread Duncan Murdoch
On 16/08/2014, 9:36 PM, Daniel Braithwaite wrote: R CMD check does not object to this code when checking a package: foo1 - function (bar) { with(bar, { x }) } but produces a warning: foo2: no visible binding for global variable 'x' in response to this: foo2 -

Re: [R] no visible binding for global variable and with() vs. within()

2014-08-17 Thread Rolf Turner
On 17/08/14 23:05, Duncan Murdoch wrote: On 16/08/2014, 9:36 PM, Daniel Braithwaite wrote: R CMD check does not object to this code when checking a package: foo1 - function (bar) { with(bar, { x }) } but produces a warning: foo2: no visible binding for global variable 'x' in