From pdalgd at gmail.com  Thu Mar 29 15:47:14 2012
From: pdalgd at gmail.com (peter dalgaard)
Date: Thu, 29 Mar 2012 15:47:14 +0200
Subject: [Rd] CRAN policies
In-Reply-To: <1333025892.27217.141.camel@brian-rcg>
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>
	<1333025892.27217.141.camel@brian-rcg>
Message-ID: <EF098E2D-F06A-4F97-980A-084E73ED6129@gmail.com>


On Mar 29, 2012, at 14:58 , Brian G. Peterson wrote:

> 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

Context, please. Where does this happen? (and why do you need data(cars)?)

I find it hard to believe that quoting the formula should be the solution to this issue. There must be tons of examples to the contrary.


> 
> 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
> 
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

-- 
Peter Dalgaard, Professor
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Email: pd.mes at cbs.dk  Priv: PDalgd at gmail.com



[Rd] CRAN policies
peter dalgaard