Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

do not need strict monotonicity in Hyman method

git-svn-id: https://svn.r-project.org/R/trunk@60910 00db46b3-68df-0310-9c12-caf00c1e9a41
  • Loading branch information...
commit d1b8bbdca3f1683391008f3cdfc80c4b37454295 1 parent be5c39d
ripley authored
4 src/library/stats/R/spline.R
@@ -42,8 +42,8 @@ spline <-
42 42 }
43 43 if(method == 4L) {
44 44 dy <- diff(y)
45   - if(!(all(dy > 0) || all(dy < 0)))
46   - stop("'y' must be strictly increasing or decreasing")
  45 + if(!(all(dy >= 0) || all(dy <= 0)))
  46 + stop("'y' must be increasing or decreasing")
47 47 }
48 48
49 49 if(missing(xout)) xout <- seq.int(xmin, xmax, length.out = n)
4 src/library/stats/R/splinefun.R
@@ -55,8 +55,8 @@ splinefun <-
55 55 "monoH.FC", "hyman"))
56 56 if(iMeth == 5L) {
57 57 dy <- diff(y)
58   - if(!(all(dy > 0) || all(dy < 0)))
59   - stop("'y' must be strictly increasing or decreasing")
  58 + if(!(all(dy >= 0) || all(dy <= 0)))
  59 + stop("'y' must be increasing or decreasing")
60 60 }
61 61 z <- .Call(C_SplineCoef, min(3L, iMeth), x, y)
62 62 if(iMeth == 5L) z <- spl_coef_conv(hyman_filter(z))
5 src/library/stats/man/splinefun.Rd
@@ -24,12 +24,11 @@ spline(x, y = NULL, n = 3*length(x), method = "fmm",
24 24 splinefunH(x, y, m)
25 25 }
26 26 \arguments{
27   - \item{x,y}{vectors giving the coordinates of the points to be
  27 + \item{x, y}{vectors giving the coordinates of the points to be
28 28 interpolated. Alternatively a single plotting structure can be
29 29 specified: see \code{\link{xy.coords}}.
30 30
31   - \code{y} must be strictly increasing or decreasing
32   - for \code{method = "hyman"}.
  31 + \code{y} must be increasing or decreasing for \code{method = "hyman"}.
33 32 }
34 33 \item{m}{(for \code{splinefunH()}): vector of \emph{slopes}
35 34 \eqn{m_i}{m[i]} at the points \eqn{(x_i,y_i)}{(x[i],y[i])}; these

0 comments on commit d1b8bbd

Please sign in to comment.
Something went wrong with that request. Please try again.