From murdoch.duncan at gmail.com  Mon Dec  8 22:29:24 2014
From: murdoch.duncan at gmail.com (Duncan Murdoch)
Date: Mon, 08 Dec 2014 16:29:24 -0500
Subject: [Rd] CRAN packages mis-using \donttest : falsy
In-Reply-To: <CABtg=KkYCz0693zTAFmKQks9bB9L7X6pMkGLu9ZbfCtn_mAwpQ@mail.gmail.com>
References: <E1Xxxaa-0002Jr-S8@gannet.stats.ox.ac.uk>	<CABtg=K=CjWEOO-TCDimERxS6a79oL+Kw=BYtFxy4PbHjH_5POQ@mail.gmail.com>	<54860AF2.6050509@gmail.com>	<CABtg=K=A9h4Why19-dy_dWHWbJoR8iKUAUL_1gbk8LawQKvpDg@mail.gmail.com>	<54860D5E.3090607@gmail.com>
	<CABtg=KkYCz0693zTAFmKQks9bB9L7X6pMkGLu9ZbfCtn_mAwpQ@mail.gmail.com>
Message-ID: <54861834.2040402@gmail.com>

On 08/12/2014 4:12 PM, G?bor Cs?rdi wrote:
> On Mon, Dec 8, 2014 at 3:43 PM, Duncan Murdoch <murdoch.duncan at gmail.com> 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



[Rd] CRAN packages mis-using \donttest : falsy
Duncan Murdoch