[Rd] mistake in approx() documentation (PR#1154)

htang@hpl.hp.com htang@hpl.hp.com
Tue, 30 Oct 2001 19:42:07 +0100 (MET)


Full_Name: Hsiu-Khuern Tang
Version: 1.3.1
OS: Debian GNU/Linux unstable
Submission from: (NULL) (192.6.19.124)


Hi,

The current documentation for approx() contains the following paragraph:

       f: For `method="constant"' a number between 0 and 1 inclusive,
          indicating a compromise between left- and right-continuous
          step functions. If `y0' and `y1' are the values to the left
          and right of the point then the value is `y0*f+y1*(1-f)' so
          that `f=0' is right-continuous and `f=1' is left-continuous.

The formula

y0*f+y1*(1-f)

should be

y0*(1-f)+y1*f

This will make it consistent with the claim that "`f=0' is right-continuous and
`f=1' is left-continuous", as well as with the actual code:

approx(1:2, 1:2, xout=1.5, method="constant", f=1)
$x
[1] 1.5

$y
[1] 2

Best,
Hsiu-Khuern.


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._