[Rd] CRAN policies

Brian G. Peterson brian at braverock.com
Thu Mar 29 14:58:12 CEST 2012


On Thu, 2012-03-29 at 16:52 +1300, Thomas Lumley 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.
> 
'occasionally' seems like an understatement.

Here's an example:

data(cars)
lm(speed ~ dist,cars) #would produce global variables NOTE
lm("speed ~ dist",cars) # would not produce the NOTE

While the change required to avoid the CRAN NOTE is small, I can't think
of a single example or text on using formulas that recommends quoting
the formula as a best practice.  I'm not sure how users or package
authors are supposed to know that they should use a (non standard) way
of specifying the formula to avoid wasting their time, and the CRAN
volunteers time.  I'm certain that there are many other examples, but
this one was easy to demonstrate.

Regards,

   - Brian

-- 
Brian G. Peterson
http://braverock.com/brian/
Ph: 773-459-4973
IM: bgpbraverock



More information about the R-devel mailing list