On 08/12/2014 4:12 PM, Gábor Csárdi wrote:
On Mon, Dec 8, 2014 at 3:43 PM, Duncan Murdoch <[email protected]> wrote:
[...]
> In this case, I don't see a way to include that code but avoid warnings.  So
> you could ask for forgiveness when you submit it to CRAN (and perhaps they
> would be forgiving), or you could use some other code in your example.

Just to clarify, the code does not give any errors, or even warnings,
it runs without errors, even if these packages are not installed. So
personally I think that this is a bug in R CMD check: it detects
errors in code that does not actually produce errors.

I agree. The checks sometimes produce false positives, and I think your code would trigger some. So if the example is crucial to the user's understanding of your package, you should explain that when you submit it. But it might be easier for you (and would certainly take less time for the CRAN volunteers to assess) if you just change the example to something that doesn't trigger the false positive.

It's pretty similar to the "x may be undefined" warning that compilers generate: often the warning is wrong, there's no code path that uses x without defining it, but it's sometimes better to insert a clear definition than it is to leave the warning in place.

Duncan Murdoch

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Reply via email to