[R] Plotting two qqnorm plots:

Rolf Turner r.turner at auckland.ac.nz
Wed Sep 9 01:15:39 CEST 2009


njhuang86 wrote:

> Hi all,
>
> Does anyone know how to plot overlapping qqnorm plots on the same  
> window?
> Suppose I have data in the vector x and y:
>
> qqnorm(x)
> lines(qqnorm(y))
>
> I though these two lines will do the job... However, lines doesn't  
> seem to
> work. Anyways, thanks in advance!

E.g.:

set.seed(42)
x <- rnorm(100)
y <- runif(120)
qqnorm(x)
points(qqnorm(y,plot=FALSE),col="red")

If you ***really*** (???) want a line graph, then do

qqnorm(sort(x),type="l")
lines(qqnorm(sort(y),plot=FALSE),col="red")

	cheers,

		Rolf Turner

######################################################################
Attention:\ This e-mail message is privileged and confid...{{dropped:9}}




More information about the R-help mailing list