Re: [Rd] if(--as-cran)?

From: Duncan Murdoch <murdoch.duncan_at_gmail.com>
Date: Mon, 03 Sep 2012 19:52:59 -0400

On 12-09-03 7:25 PM, Spencer Graves wrote:
> Hi, Duncan et al.:
>
>
> I modified my CRAN() function (see below) to look for
> "_R_CHECK_TIMINGS_" and "R_CHECK_TIMINGS", but got "NOT CRAN" with "R
> CMD check --as-cran" from both.
>
>
> Suggestions?
> Thanks,
> Spencer
> p.s. This is fda available from R-Forge via "svn checkout
> svn://svn.r-forge.r-project.org/svnroot/fda/". It currently is
> programmed to stop no matter what. I want it to give an error "CRAN"
> with "R CMD check --as-cran" and "NOT CRAN" without "--as-cran".
> Currently, I get "NOT CRAN" for both.

The problem is with your test. If I put print(names(Sys.getenv())) into an example, I see _R_CHECK_TIMINGS_ if and only if I do the check with --as-cran. The value is supposed to be a number, not a logical.

Duncan Murdoch

>
>
> On 9/3/2012 4:41 AM, Duncan Murdoch wrote:
>> On 12-09-03 1:43 AM, Spencer Graves wrote:
>>> Hello, All:
>>>
>>>
>>> The fda package has tests that run too long for CRAN's current
>>> rules. I'd like to wrap some examples in a construct like the
>>> following:
>>>
>>>
>>> if(!CRAN()){
>>> ...
>>> }
>>>
>>>
>>> I tried the following:
>>>
>>>
>>> CRAN <- function(x='_R_CHECK_CRAN_INCOMING_'){
>>> x. <- Sys.getenv(x)
>>> xl <- as.logical(x.)
>>> notCRAN <- is.na(xl) || xl
>>> #
>>> return(!notCRAN)
>>> }
>>>
>>>
>>> The companion help page included the following example:
>>>
>>>
>>> if(CRAN()){
>>> stop('CRAN')
>>> } else {
>>> stop('NOT CRAN')
>>> }
>>>
>>>
>>> This reported "NOT CRAN" even with "R CMD check --as-cran".
>>
>> There's no user-visible setting for --as-cran, because it just sets a
>> number of other options. You could query one of those. The settings
>> that are visible are
>>
>> _R_CHECK_TIMINGS_ (which seems most relevant to you)
>> _R_CHECK_INSTALL_DEPENDS_
>> _R_CHECK_NO_RECOMMENDED_
>> _R_SHLIB_BUILD_OBJECTS_SYMBOL_TABLES_
>>
>> So I'd check the value in _R_CHECK_TIMINGS_, or maybe just its existence.
>>
>> Duncan Murdoch
>>
>



R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Mon 03 Sep 2012 - 23:57:42 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 04 Sep 2012 - 03:00:41 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive