[R-pkg-devel] some notes

Spencer Graves spencer.graves at effectivedefense.org
Tue Apr 24 22:49:06 CEST 2018

On 2018-04-24 12:23, Uwe Ligges wrote:
> On 24.04.2018 19:15, Spencer Graves wrote:
>> On 2018-04-24 12:01, Duncan Murdoch wrote:
>>> On 24/04/2018 12:48 PM, Uwe Ligges wrote:
>>>> On 24.04.2018 18:45, Spencer Graves wrote:
>>> [... deleting irrelevant stuff...]
>>>>>         If it becomes infeasible to find smaller datasets, etc., 
>>>>> you can
>>>>> cut out certain tests with a construct like the following:
>>>>> if(!fda::CRAN()){
>>>>> # ... tests to run on other computers but to skip on CRAN. ...
>>>>> }
>>>> Ummm, how should fda::CRAN() now that it runs on CRAN?
>>>> CRAN prefers to ship a set of examples/tests etc. that meet our
>>>> requirements. If you want to ru addtional tests and/or examples, then
>>>> run them conditionally on something that is true for your local 
>>>> machine,
>>>> e.g. some defined environment variable.
>>        The fda::CRAN() function tests a "defined environmental 
>> variable", as you suggest:  It is TRUE with "R CMD check –as-cran" 
>> and FALSE if "-as-cran" (or something like that)
> The something like that is rather relevant. For example, I never use 
> --as-cran on my machine, and most CRAN machines do only on incoming 
> check but not the regular daily checks ...

       I very much appreciate your time and effort in maintaining CRAN.  
The precise code used is as follows:

CRAN <- function (CRAN_pattern, n_R_CHECK4CRAN){
     gete <- Sys.getenv()
     ngete <- names(gete)
     i <- seq(along = gete)
     if (missing(CRAN_pattern)) {
         if ("_CRAN_pattern_" %in% ngete) {
             CRAN_pattern <- gete["_CRAN_pattern_"]
         else CRAN_pattern <- "^_R_"
     if (missing(n_R_CHECK4CRAN)) {
         if ("_n_R_CHECK4CRAN_" %in% ngete) {
             n_R_CHECK4CRAN <- as.numeric(gete["_n_R_CHECK4CRAN_"])
         else n_R_CHECK4CRAN <- 5
     for (pati in CRAN_pattern) i <- i[grep(pati, ngete[i])]
     cran. <- (length(i) >= n_R_CHECK4CRAN)
     attr(cran., "Sys.getenv") <- gete
     attr(cran., "matches") <- i

       This seems to do what I think we both wanted:  not run the longer 
examples on CRAN but still allow them to be run elsewhere. If you want 
something different here, Uwe, please tell me what you want.  If it's 
reasonably easy to implement, I will.

       FYI, I just checked the "CRAN Package Check Results for Package 
fda":  It returned "OK" on 8 of the 12 "flavors", but returned "ERROR" 
on the other four.  NONE of those errors were for excess time.  Instead, 
they were for <<no applicable method for 'knots' applied to an object of 
class "fd">>.   The NAMESPACE file for "fda" includes both 
"export(knots.fd)" and "S3method(knots, fd)".

       What should I do about this intermittent error?


> Best,
> Uwe
>  is not set.  It has been
>> several years since I wrote that code, and I'm not prepared at the 
>> moment to defend exactly how it works. It was how I resolved a 
>> conflict between Jim Ramsay, the maintainer and lead author of "fda", 
>> CRAN maintainers like Uwe, and other contributors to "fda", 
>> especially Giles Hooker and me:  It allowed us to keep examples in 
>> "fda" help files without excessive work trying to find examples that 
>> would illustrate the same points with less compute time.
>>> For Xubo Yue, who may not be aware of all of the players:
>>> Uwe Ligges is one of the individuals who runs CRAN.  When you submit 
>>> a package to CRAN, you are asking Uwe and others to distribute your 
>>> work. You should listen to what he says.
>>> Spencer Graves and I are not involved in running CRAN.  We will give 
>>> you advice that we think is good advice, but if it conflicts with 
>>> Uwe's, follow his.
>>> Duncan Murdoch
>>        Moreover, Duncan's contributions to the R Project vastly 
>> exceed mine.  If any of my suggestions seem to conflict with Duncan's 
>> comments, follow his (unless they conflict with someone like Uwe, as 
>> Duncan noted).
>>        Spencer Graves

	[[alternative HTML version deleted]]

More information about the R-package-devel mailing list