Re: [Rd] R CMD check returns NOTE about package data set as global variable

From: peter dalgaard <pdalgd_at_gmail.com>
Date: Fri, 06 Apr 2012 22:33:14 +0200

On Apr 6, 2012, at 22:23 , Hervé Pagès wrote:

> On 04/06/2012 12:33 PM, Brad McNeney wrote:

>> OK, thanks for the tip on good coding practice. I'm still getting the NOTE though when I make the suggested change.

>
> Because when you do return(RutgersMapB36[,1]), the code checker has no
> way to know that the RutgersMapB36 variable is actually defined.
>
> Try this:
>
> test<-function() {
> RutgersMapB36 <- NULL
> data(RutgersMapB36)
> return(RutgersMapB36[,1])
> }
>

That might remove the NOTE, but as far as I can see, it also breaks the code...

-- 
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

______________________________________________
R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Received on Fri 06 Apr 2012 - 20:35:01 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 06 Apr 2012 - 21:20:41 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive