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

From: Warnes, Gregory <>
Date: Thu, 06 Sep 2012 13:33:54 +0000

On 9/6/12 7:41 AM, "Duncan Murdoch" <> wrote:

>If Martin or I added a new environment variable _R_CHECK_LEVEL_, and
>perhaps support code to let you set it in R CMD check or elsewhere, and
>support functions to let you read it without the work of calling
>Sys.getenv(), and documentation for its purpose -- that doesn't mean it
>would be ever be used. I would have no objection whatsoever if he wants
>to do that work, [..]
>So if Martin wants to implement something, I'd suggest that he
>coordinate offline with CRAN.

With this in mind, I've taken the time to create a proposed implementation:

  1. New environement variable _R_CHECK_LEVEL_ which can take values from {NONE, MINOR, CRAN, DEFAULT, MAJOR, FULL}
  2. New R CMD CHECK flag --level={NONE, MINOR, CRAN, DEFAULT, MAJOR, FULL}, which sets the value of _R_CHECK_LEVEL_, defaulting to "DEFAULT".
  3. R CMD CHECK flag --as-cran sets _R_CHECK_LEVEL_ to CRAN (overwriting any previous environment variable or --level setting)
  4. A new function: tools::getCheckLevel() that returns an ordered factor with levels {NONE, MINOR, CRAN, DEFAULT, MAJOR, FULL}.
  5. An associated man page, with the example:
	if(getCheckLevel() > "CRAN") {
	    cat("## Do time-intenstive test ##\n")
	} else {
	    cat("## Do brief test\n")

Duncan, how should I coordinate this with CRAN, simply drop an email to

Everyone: I'll post a pointer to the patch as soon as I've tested it.

-Greg mailing list Received on Thu 06 Sep 2012 - 13:36:32 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 Fri 07 Sep 2012 - 15:20:41 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive