Using ggplot2 in a package

Due to my recent conversion to ggplot2, I am starting to use ggplot() in packages. Running R CMD check on this function

    ggplot(data=data.frame(n=1:n,v=object@vars),
           aes(x=n,y=v))

I got the note

* checking R code for possible problems ... NOTE
colocpc.plot: no visible binding for global variable ā€˜vā€™

It turns out this is a known feature of the R checking code. v is indeed undefined. I like a clean run of R CMD check --as-cran for all packages. The link gives a discussion of alternative work-arounds:

Continue reading

Advertisements