[R-pkg-devel] NOTE: Error while checking: invalid 'envir'-argument

peter dalgaard pdalgd at gmail.com
Thu Jul 9 21:20:54 CEST 2015


> On 09 Jul 2015, at 20:56 , Martin Maechler <maechler at stat.math.ethz.ch> wrote:
> 
> 
>> Alexandra,
>> I got the same error for this line of code:
> 
>> e <- new.env()
>> data("mydataset", envir=e)
> 
>> As you said it doesn't appear for R 3.2.1. I don't know why that should 
>> be wrong and would be interested to know, but my hack is this:
> 
>> e <- new.env()
>> do.call("data", list("mydataset", envir=e))
> 
>> Hana
> 
> Hmm,  that would look like a bug in your version of R-devel.
> In my version of "R-devel" (and R 3.2.1, and "R 3.2.1 patched"), 
> I get
> 
>> rm(e); e <- new.env(); data(votes.repub, envir=e); ls(e); dim(e$votes.repub)
>  [1] "votes.repub"
>  [1] 50 31
>> 
> 
>> R.version.string
>  [1] "R Under development (unstable) (2015-07-07 r68640)"
>> 
> 
> What is your R.version.string very you see the problem?
> What's 
>       sessionInfo() ?
> 
> Best,
> Martin

I suspect that that is not the way to check it, Martin. As I understand it, the warning comes during R CMD check, possibly via one of the static code analysis checks. So what you really should do is write a package with the construction inside one of its functions or help files, and then try R CMD check --as-cran on it. I tried a simpler way:

> library(codetools)
> foo <- function(){e <- new.env(); data("airquality", envir=e); e}
> checkUsage(foo, all=TRUE)

but that doesn't trigger the issue either...

-pd

> 
>> On 7/9/15 10:24 AM, peter dalgaard wrote:
>>> Hi Alexandra,
>>> 
>>> Is it possible to narrow down a bit more where the message comes from? That error message doesn't give much of a clue.
>>> 
>>> -pd
>>> 
>>>> On 09 Jul 2015, at 15:07 , Alexandra Kuznetsova <alku at dtu.dk> wrote:
>>>> 
>>>> Hi all,
>>>> 
>>>> I am checking the package with the -as-cran option using R Under
>> development (unstable) (2015-07-08 r68642). I get the following NOTE:
>> Error while checking: invalid 'envir'-argument. Does anyone know how to
>> fix that NOTE? I do not get it with the R 2.3.1
>>>> 
>>>> Alexandra
>>>> 
>>>> 
>>>> 	[[alternative HTML version deleted]]
>>>> 
>>>> ______________________________________________
>>>> R-package-devel at r-project.org mailing list
>>>> https://stat.ethz.ch/mailman/listinfo/r-package-devel
>>> 
> 
>> ______________________________________________
>> R-package-devel at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-package-devel
> 
> ______________________________________________
> R-package-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-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



More information about the R-package-devel mailing list