From brian at braverock.com  Thu Mar 29 14:58:12 2012
From: brian at braverock.com (Brian G. Peterson)
Date: Thu, 29 Mar 2012 07:58:12 -0500
Subject: [Rd] CRAN policies
In-Reply-To: <CAJ55+d+cTBjmhWt86W=fQMJq2_Zxib-4ufTobbF7z7W1LYfDyg@mail.gmail.com>
References: <CB9770B4.36D98%jeff.a.ryan@gmail.com>
	<4F731B09.5000203@statistik.tu-dortmund.de>
	<CAP01uRmob_VSmgVc80yek3g4D3K0tedmmU1EbmHJ3CCpgRQDgw@mail.gmail.com>
	<CAJ55+d+cTBjmhWt86W=fQMJq2_Zxib-4ufTobbF7z7W1LYfDyg@mail.gmail.com>
Message-ID: <1333025892.27217.141.camel@brian-rcg>

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



[Rd] CRAN policies
Brian G. Peterson