[Rd] splinefun bug (PR#7290)

maechler at stat.math.ethz.ch maechler at stat.math.ethz.ch
Fri Oct 15 19:36:59 CEST 2004


>>>>> "kjetil" == kjetil halvorsen <kjetil at acelerate.com>
>>>>>     on Fri, 15 Oct 2004 18:49:09 +0200 (CEST) writes:

    kjetil> The following reliably bombs R, or at least rw2000 (windows XP):

    kjetil> test <- splinefun(vector(length=0), vector(length=0))
    kjetil> test(1)

yes, that's a reproducible bug, thank you.

The embarassing thing is that we've fixed this bug already for 
approxfun() -- and some of us know that  spline* and approx*
have originally been very much in parallel...

BTW: No need to give the function a name: S can nicely work with
     anonymous functions. Consequently, you can get the same effect from

    splinefun(vector(length=0), vector(length=0)) (1)

or, even a bit more compactly:

    splinefun(1[0], 1[0]) (1)

Martin Maechler



More information about the R-devel mailing list