[R] why this doesn't work for qqnorm
Simon Blomberg
s.blomberg1 at uq.edu.au
Fri Jun 29 05:05:36 CEST 2007
You need to specify a whole column. try qqnorm(table[,1])
On Thu, 2007-06-28 at 18:50 -0700, Jiong Zhang, PhD wrote:
> I want to qqnorm every column in a table. When I try the first column
> using
>
> qqnorm(table$column1), it worked.
>
> But when I use
>
> qqnorm(table[1]), it tells me "Error in stripchart(x1, ...) : invalid
> plotting method".
>
> What happen? How can I make a function that qqnorms every column?
Try this:
dat <- data.frame(x=rnorm(20), y= rnorm(20), z =rnorm(20))
par(mfrow=c(3,1))
sapply(dat, function (x) {qqnorm (x) ; qqline (x) } )
Cheers,
Simon
>
> thanks a lot.
>
> -jiong
> The email message (and any attachments) is for the sole use of the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message (and any attachments). Thank You.
>
>
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
--
Simon Blomberg, BSc (Hons), PhD, MAppStat.
Lecturer and Consultant Statistician
Faculty of Biological and Chemical Sciences
The University of Queensland
St. Lucia Queensland 4072
Australia
Room 320, Goddard Building (8)
T: +61 7 3365 2506
email: S.Blomberg1_at_uq.edu.au
The combination of some data and an aching desire for
an answer does not ensure that a reasonable answer can
be extracted from a given body of data. - John Tukey.
More information about the R-help
mailing list