replacement for qqnorm

Kjetil Halvorsen khal@alumni.uv.es
Mon, 01 Mar 1999 12:05:12 +0100


I propose the folloving (few changes) replacement for qqnorm. 

1) return invisible (when plot.it=false) a list which can be
    given directly to plot to make the quantile plot. This is the
behaviour of qqplot.

2) calls ppoints

Kjetil Halvorsen




 
       qqnorm  <- 
function (y, ylim, main = "Normal Q-Q Plot", xlab = "Theoretical
Quantiles", 
    ylab = "Sample Quantiles", plot.it = TRUE, ...) 
{
    y <- y[!is.na(y)]
    if (!length(y)) 
        stop("y is empty")
    if (missing(ylim)) 
        ylim <- range(y)
    x <- qnorm(ppoints(length(y)))
    sy <- sort(y)
    if (plot.it) 
        plot(x, sort(y), main = main, xlab = xlab, ylab = ylab, 
            ylim = ylim, ...)
    invisible(list(x = x, y = sy))
}
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._