Re: [Rd] ppoints (PR#7538)

From: Prof Brian Ripley <ripley_at_stats.ox.ac.uk>
Date: Mon 24 Jan 2005 - 20:37:44 EST

On Wed, 19 Jan 2005 tobias.verbeke@telenet.be wrote:

> Dear r-bugs,
>
> Whilst playing with ppoints I discovered
> that when one uses it directly, occasional
> NA's in a vector also become data fractions:
>
> ppoints(c(1,2,NA,4))
>
> Would it be a good idea to add a warning message
> as in:
>
> ppoints <- function (n, a = ifelse(n <= 10, 3/8, 1/2))
> {
> if(any(is.na(n))) warning("'n' contains NA's")
> if(length(n) > 1) n <- length(n)
> if(n > 0)
> (1:n - a)/(n + 1-2*a)
> else numeric(0)
> }

Why? There are 4 points in your vector, and the result is perfectly valid as documented, even if they were all NAs.

> Another minor remark concerning ?ppoints. It says:
>
> n: either the number of points generate or a vector of
> observations. ^^^^^

As you see, that does not line up, but the typo has been fixed.

-- 
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________
R-devel@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Received on Mon Jan 24 21:21:43 2005

This archive was generated by hypermail 2.1.8 : Fri 18 Mar 2005 - 09:02:37 EST