s-news
[Top] [All Lists]

SUMMARY - Boxplot question

To: "'s-news@lists.biostat.wustl.edu'" <s-news@lists.biostat.wustl.edu>
Subject: SUMMARY - Boxplot question
From: "Paul, David A" <paulda@BATTELLE.ORG>
Date: Tue, 21 Jan 2003 10:44:31 -0500
I have received two very helpful replies, copied below.
Thanks much to Andy Liaw and Sundar Dorai-Raj.

-david paul

-----Original  Post -----

My data have three columns: data$relative.humidity, data$precipitation, 
and data$temperature. 

I have been using "boxplot(split(data$relative.humidity, group), 
                         split(data$precipitation, group), 
                                     split(data$temperature, group))" 

The output from this command is less than ideal. 
I would like to produce a graph with two sets of boxplots such that the 
graph is divided into two halves, the left half corresponding to group = 1 
and the right half corresponding to group = 2, where each "half" of the
graph 
contains three boxplots corresponding to the three variables.  
Labels below each "half" would be ideal. 

---------------------

How about:
par(mfrow=c(1,2))
lapply(split(data,data$group),
function(x) {
boxplot(x$relative.humidity, x$precipitation, x$temperature)
mtext(side = 1, text = paste("Group =", unique(x$group)))
NULL # return nothing
})
WARNING: untested code. Also assumes `group' is a column in `data'.

Regards,
Sundar 

--------------------

Sounds like a job for bwplot().

Andy

-------------------- 

<Prev in Thread] Current Thread [Next in Thread>
  • SUMMARY - Boxplot question, Paul, David A <=