Use of R internal entry points in packages IBDsim and timeSeries

Prof Brian Ripley ripley at stats.ox.ac.uk
Wed Aug 8 10:53:12 CEST 2012


On Tue, 7 Aug 2012, Yohan Chalabi wrote:

>
> On Aug 1, 2012, at 2:52 PM, Prof Brian Ripley wrote:
>
>> We see in R CMD check in current R-devel
>>
>> * checking foreign function calls ... WARNING
>> Foreign function call(s) with ‘PACKAGE’ argument in a base package:
>>  .C("find_interv_vec", ..., PACKAGE = "base")
>>
>> This is not part of the R API and will be removed shortly.
>>
>
> Thanks for pointing out that find_interv_vec will has been removed from R-dev. We will make the due changes in the timeSeries package.
>
>> Your uses of it are in any case incorrect and dangerous (e.g. length() does not need to return an integer and might be NA: see its help page).
>>
>> Please remove this from your code (and be aware that such calls are seen as prime facie evidence of copying from the R sources, which you have not acknowledged).
>
> It is mentioned in the source code that we prefer to call the 
> underlining C routine of findInterval(). Moreover, we only call the 
> C routine and we have not copied the code in findInterval().

But you did: you copied to write

     .C("find_interv_vec", xt = pos, n = length(pos), x = ipos,
        nx = nx, FALSE, FALSE, i, DUP = FALSE, NAOK = TRUE,
        PACKAGE = "base")

which are not otherwise documented.  You need to acknowledge that this 
is an edited copy of R-core's code.  And most of the parts which 
differ from the current findInterval() are in fact wrong: nx need not 
be of type integer and could be NA, for example.  And if it were 
called with the wrong type, the crash would be attributed to R's 
internals and not to your error.

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595


More information about the Rmetrics-core mailing list