Problem with spline method = 'monoH.FC''

I am interested in using the monotone spline, but I get an error when R tries to use it. I am using R 2.12.0, and the method 'monoH.FC' says that it has been supported since 2.8.0

Reproducible example (same result for more complicated (x,y) relationships)

x<-1:2
y<-1:2
spline(x,y,method="monoH.FC")
    Error in spline(x, y, method = "monoH.FC") : invalid interpolation method

What I have tried

?spline returns:

...
Usage:
...
        spline(x, y = NULL, n = 3*length(x), method = "fmm",
        xmin = min(x), xmax = max(x), xout, ties = mean)
...
Arguments:
  method: specifies the type of spline to be used.  Possible values are
      ‘"fmm"’, ‘"natural"’, ‘"periodic"’ and ‘"monoH.FC"’.
...

But the spline function itself indicates that the 'monoH.FC' method is not supported:

...
method <- pmatch(method, c("periodic", "natural", "fmm"))
if (is.na(method)) 
    stop("invalid interpolation method")
...

Question

How can I use method = 'monoH.FC' with spline?

5
задан David LeBauer 4 January 2011 в 17:11
поделиться