[Rd] if(--as-cran)?
Henrik Bengtsson
hb at biostat.ucsf.edu
Mon Sep 3 09:49:35 CEST 2012
Hi, see thread "[Rd] Proposal: Mechanism for controlling the amount of
testing 'R CMD check' performs" on April 8, 2012:
https://stat.ethz.ch/pipermail/r-devel/2012-April/063809.html
/Henrik
On Sun, Sep 2, 2012 at 10:43 PM, Spencer Graves
<spencer.graves at prodsyse.com> 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".
>
>
> Suggestions?
> Thanks,
> Spencer
>
>> sessionInfo()
> R version 2.15.1 (2012-06-22)
> Platform: i386-pc-mingw32/i386 (32-bit)
>
> locale:
> [1] LC_COLLATE=English_United States.1252
> [2] LC_CTYPE=English_United States.1252
> [3] LC_MONETARY=English_United States.1252
> [4] LC_NUMERIC=C
> [5] LC_TIME=English_United States.1252
>
> attached base packages:
> [1] stats graphics grDevices utils datasets methods base
>
> other attached packages:
> [1] sos_1.3-5 brew_1.0-6
>
> loaded via a namespace (and not attached):
> [1] tools_2.15.1
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
More information about the R-devel
mailing list