# ppoints

**Martin Maechler
**
Martin Maechler <maechler@stat.math.ethz.ch>

*Thu, 3 Sep 1998 18:29:06 +0200*

Thank you, Bill, for raising this point!
>>>>>* "Bill" == Bill Simpson <wsimpson@uwinnipeg.ca> writes:
*
Bill> When I look at ppoints I see:
Bill> ppoints<-function (x)
Bill> {
Bill> n <- length(x)
Bill> if (n == 1)
Bill> n <- x
Bill> (1:n - 0.5)/n
Bill> }
Bill> However Venables & Ripley (2nd ed, p 165) say ppoints() should return
Bill> (i-1/2)/n for n>=11; (i-3/8)/(n+1/4) for n<=10.
Bill> The version below should work as described:
Bill> ppoints<-function (x)
Bill> {
Bill> n <- length(x)
Bill> if (n <= 10)
Bill> (1:n - 0.375)/(n + 0.25)
Bill> else
Bill> (1:n - 0.5)/n
Bill> }
However, if changing ppoints(.) for compatibility
we should do it properly.
e.g., the case
ppoints(10)
should give the same as
ppoints(1:10).
Also, S has the much nicer extra argument 'a' with the default
if(is.null(a))
a <- if(n > 10) 0.5 else 0.375
which leads to the behavior you cite below.
Maybe the S authors would forgive us we just used S' version ppoints()?
(it's S, not S-plus!)
Martin
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._