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

2012-04-06 Thread peter dalgaard
On Apr 6, 2012, at 23:04 , Brian G. Peterson wrote: > Honestly, this is just another example of a non-helpful 'global > variable' NOTE. I've removed many of these from our packages, often by > resorting to useless workarounds like this one, but I have never once > gotten a valid NOTE out of this

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

2012-04-06 Thread Hervé Pagès
Hi Brian, On 04/06/2012 02:04 PM, Brian G. Peterson wrote: On Fri, 2012-04-06 at 13:23 -0700, Hervé Pagès wrote: test<-function() { RutgersMapB36<- NULL data(RutgersMapB36) return(RutgersMapB36[,1]) } That won't work, but this should: RutgersMapB36<- NULL test<-function() {

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

2012-04-06 Thread Henrik Bengtsson
On Fri, Apr 6, 2012 at 1:33 PM, peter dalgaard wrote: > > 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 y

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

2012-04-06 Thread Brian G. Peterson
On Fri, 2012-04-06 at 13:23 -0700, Hervé Pagès wrote: > test<-function() { > RutgersMapB36 <- NULL > data(RutgersMapB36) > return(RutgersMapB36[,1]) > } That won't work, but this should: RutgersMapB36 <- NULL test<-function() { data(RutgersMapB36) return(RutgersMapB36[,1]) }

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

2012-04-06 Thread Hervé Pagès
On 04/06/2012 01:33 PM, peter dalgaard wrote: 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(RutgersMapB

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

2012-04-06 Thread Brad McNeney
Thanks (to all), using LazyData removes the note. Brad - Original Message - > From: "Prof Brian Ripley" > To: "Brad McNeney" > Cc: r-devel@r-project.org > Sent: Friday, 6 April, 2012 12:43:22 PM > Subject: Re: [Rd] R CMD check returns NOTE about package data set as global > variable >

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

2012-04-06 Thread Brad McNeney
Package users should have access. Brad - Original Message - > From: "Hadley Wickham" > To: "Brad McNeney" > Cc: r-devel@r-project.org > Sent: Friday, 6 April, 2012 12:38:11 PM > Subject: Re: [Rd] R CMD check returns NOTE about package data set as global > variable > > Is the dataset

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

2012-04-06 Thread peter dalgaard
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

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

2012-04-06 Thread Hervé Pagès
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

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

2012-04-06 Thread peter dalgaard
On Apr 6, 2012, at 21:33 , 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. Hm? It's not like Brian to get such things wrong, did you check properly? Perhaps the code checker is not smart enough to know

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

2012-04-06 Thread Prof Brian Ripley
On Fri, 6 Apr 2012, 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. Yes, you will: data() is a function with side effects, which is contrary to the functional programming model being checked. So there

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

2012-04-06 Thread Hadley Wickham
Is the dataset something that package users will need, or just your package's functions? Hadley On Fri, Apr 6, 2012 at 1:46 PM, Brad McNeney wrote: > I'm developing a package that comes with a data set called RutgersMapB36. One > of the package's functions requires this data frame. A toy example

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

2012-04-06 Thread Brad McNeney
OK, thanks for the tip on good coding practice. I'm still getting the NOTE though when I make the suggested change. In case it matters, I'm check'ing with R version 2.15.0 (2012-03-30) Platform: i386-pc-mingw32/i386 (32-bit) Brad - Original Message - > From: "Prof Brian Ripley" > To:

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

2012-04-06 Thread Prof Brian Ripley
On 06/04/2012 19:46, Brad McNeney wrote: I'm developing a package that comes with a data set called RutgersMapB36. One of the package's functions requires this data frame. A toy example is: test<-function() { data(RutgersMapB36) return(RutgersMapB36[,1]) } R CMD check returns a NOTE: t

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

2012-04-06 Thread Brad McNeney
I'm developing a package that comes with a data set called RutgersMapB36. One of the package's functions requires this data frame. A toy example is: test<-function() { data(RutgersMapB36) return(RutgersMapB36[,1]) } R CMD check returns a NOTE: test: no visible binding for global variable '

Re: [Rd] Compatibility problem with R-2.9.0 and R-2.14.0

2012-04-06 Thread Duncan Murdoch
On 12-04-06 7:05 AM, harold.petithomme wrote: Hello all, Using classical glm function with binomial family, I experienced a problem when using predict() over a glm object. I found that family objects built on R-2.14.0 contain elements like : .Call(C_logit_link,...) But on R-2.9.0, the object C

Re: [Rd] R datasets ownership(copyright) and license

2012-04-06 Thread S Ellison
> My understanding is that rationality is not the case in > Europe - see e.g. http://en.wikipedia.org/wiki/Database_Directive. I know we don't always see England as part of Europe, but 'ouch' anyway... This is not copyright law. It is protection of databases, and that is a different set of le

[Rd] Compatibility problem with R-2.9.0 and R-2.14.0

2012-04-06 Thread harold.petithomme
Hello all, Using classical glm function with binomial family, I experienced a problem when using predict() over a glm object. I found that family objects built on R-2.14.0 contain elements like : .Call(C_logit_link,...) But on R-2.9.0, the object C_logit_link can not be found. Instead, this pr