s-news
[Top] [All Lists]

Re: Graphical representation of variable

To: "Richard M. Heiberger" <rmh@temple.edu>
Subject: Re: Graphical representation of variable
From: "Jean V Adams" <jvadams@usgs.gov>
Date: Fri, 17 Sep 2004 09:04:46 -0400
Cc: Glenn.Treacy@ILIM.COM, s-news@lists.biostat.wustl.edu
Using Rich's example data, weights, another possibility is a stacked bar
chart:

barplot(weights)

JVA

`·.,,  ><(((º>   `·.,,  ><(((º>   `·.,,  ><(((º>

Jean V. Adams
Statistician
U.S. Geological Survey
Great Lakes Science Center
c/o Marquette Biological Station
1924 Industrial Parkway
Marquette, MI 49855  USA
phone: 906-226-1212
FAX: 906-226-3632
web site: www.glsc.usgs.gov
e-mail: jvadams@usgs.gov


                                                                                
                                                         
                      "Richard M. Heiberger"                                    
                                                         
                      <rmh@temple.edu>                 To:       
Glenn.Treacy@ILIM.COM, s-news@lists.biostat.wustl.edu                   
                      Sent by:                         cc:                      
                                                         
                      s-news-owner@lists.biosta        Subject:  Re: [S] 
Graphical representation of variable                            
                      t.wustl.edu                                               
                                                         
                                                                                
                                                         
                                                                                
                                                         
                      09/16/2004 10:04 PM                                       
                                                         
                                                                                
                                                         
                                                                                
                                                         


Is this the type of graph you are interested in?  If so, we can
refine its details

## weights
##    t1   t2   t3
## A  .5   .4   .3
## B  .5   .2   .1
## C  .0   .4   .6


weights <- matrix(c(.5,.4,.3, .5,.2,.1, .0,.4,.6), 3,3, byrow=T,
                  dimnames=list(c("A","B","C"), c("t1","t2","t3")))

weights2 <- data.frame(weights=as.vector(weights),
                       time=rep(dimnames(weights)[[2]], c(3,3,3,)),
                       var=rep(dimnames(weights)[[1]], 3))

weights2

barchart(var ~ weights | time, data=weights2)



For learning about graphics in S-Plus I recommend our book

 Statistical Analysis and Data Display: An Intermediate Course with
 Examples in S-Plus, R, and SAS
by
 Richard M. Heiberger and Burt Holland

which has just been published by Springer.  You can get information at

 http://www.springeronline.com/0-387-40270-5


Rich




<Prev in Thread] Current Thread [Next in Thread>