From wdunlap at tibco.com  Thu Mar 29 18:19:14 2012
From: wdunlap at tibco.com (William Dunlap)
Date: Thu, 29 Mar 2012 16:19:14 +0000
Subject: [Rd] CRAN policies
In-Reply-To: <4F746B54.2050601@mayo.edu>
References: <mailman.19.1333015207.14516.r-devel@r-project.org>
	<4F746B54.2050601@mayo.edu>
Message-ID: <E66794E69CFDE04D9A70842786030B9328EC77@PA-MBX04.na.tibco.com>

> -----Original Message-----
> From: r-devel-bounces at r-project.org [mailto:r-devel-bounces at r-project.org] On Behalf
> Of Terry Therneau
> Sent: Thursday, March 29, 2012 7:02 AM
> To: r-devel at r-project.org
> Subject: Re: [Rd] CRAN policies
> 
> On 03/29/2012 05:00 AM, r-devel-request at r-project.org wrote:
> > The 'No visible binding for global variable" is a good example.  This
> > found some bugs in my 'survey' package, which I removed. There is
> > still one note of this type, which arises when I have to handle two
> > different versions of the hexbin package with different internal
> > structures.  The note is a false positive because the use is guarded
> > by an if(), but  CMD check can't tell this.   So, it's a good idea to
> > remove all Notes that can be removed without introducing other code
> > problems, which is nearly all of them, but occasionally there may be a
> > good reason for code that produces a Note.
> The survival package has a similar special case: the routines for
> expected population survival are set up to accept multiple types of date
> format so have lines like
>      if (class(x) == 'chron') { y <- as.numeric(x - chron("01/01/1960")}
> This leaves me with two extraneous "no visible binding" messages.

Suppose we defined a function like
  NO_VISIBLE_BINDING(expr) expr
and added an entry to the stuff in codetools so that it
would not check for misspelled object names in call to
NO_VISIBLE_BINDING.  Then Terry could write that line as
     if (class(x) == "chron") { y <- as.numeric(x - NO_VISIBLE_BINDING(chron)("01/01/1960")}
and the Notes would disappear.

Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com

> There
> used to be half a dozen but I've tried to remove as many as possible,
> for all the good reasons already articulated by the maintainers.
> 
> It still remains that 99/100 of the "no visible binding" messages I've
> seen over the years were misspelled variable names, and the message is a
> very welcome check.
> 
> Terry Therneau
> 
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel



[Rd] CRAN policies
William Dunlap