[R] qqnorm & huge datasets

Sam Steingold sds at gnu.org
Thu Dec 22 18:17:58 CET 2011

> * peter dalgaard <cqnytq at tznvy.pbz> [2011-12-21 23:59:18 +0100]:
> On Dec 21, 2011, at 23:10 , Sam Steingold wrote:
>> When qqnorm on a vector of length 10M+ I get a huge pdf file which
>> cannot be loaded by acroread or evince.
>> Any suggestions? (apart from sampling the data).
> Sample intelligently? Things like
>> qq <- seq(-4,4,,10001)
>> qqplot(qq,quantile(x,pnorm(qq)),type="l")

Perfect! Thanks!

  m <- mean(x); s <- sd(x);
  qq <- seq(min(x), max(x),, sqrt(length(x)));
  qu <- quantile(x, pnorm(qq, mean=m, sd=s));
  qqplot(qq, qu, type="l", xlab=paste("normal(",m,",",s,")"),
         ylab="log scaled weights",
         main="log scaled weight quantile");

Now, how do I add the perfect line there?
Why do neither qqline(qq) nor qqline(qu) add anything to the plot?

Sam Steingold (http://sds.podval.org/) on Ubuntu 11.10 (oneiric) X 11.0.11004000
http://www.memritv.org http://palestinefacts.org
http://thereligionofpeace.com http://mideasttruth.com http://pmw.org.il
nobody's life, liberty or property are safe while the legislature is in session

More information about the R-help mailing list