[Rd] Wish there were a "strict mode" for R interpreter. What about You?

Hadley Wickham hadley at rice.edu
Sun Apr 10 19:26:57 CEST 2011


>> Okay, I understand what you are trying to do.  Yes, you have fooled codetools in this instance.
>
> ...but notice that the codetools warning is just that: It _is_ acknowledged that these things occasionally happen by design. There are a couple of cases in base R too:
>
> * checking R code for possible problems ... NOTE
> glm.fit: no visible binding for global variable ‘n’

Are you sure that's not a bug?  There's:

aic.model <- aic(y, n, mu, weights, dev) + 2 * rank

and n.ok is defined, but n isn't defined anywhere.

> quantile.ecdf: no visible binding for global variable ‘y’

I wonder why it warns on y, but not nobs.

Hadley


-- 
Assistant Professor / Dobelman Family Junior Chair
Department of Statistics / Rice University
http://had.co.nz/



More information about the R-devel mailing list