[R] label the mean in bwplot and divide a panel in two plots

pablo.castano pablo.castano at cardif.com.co
Fri Mar 8 16:12:13 CET 2013


Hi,
 
I have the following bwplots, and want to add a label with the mean value at
each dote.
Can you give me suggestions?
Also, if  I wanted to add another bwplot below the first, can I use the
par(mfrow=c(2,1)) function?


This is my code:

Code
#Data
x<-c('Small','Large','Large','Medium','Medium','Medium','Medium','Small','Small')
y<-seq(1,9,by=1)

#Libraries
library(lattice)
library(grid)
library(Hmisc)


#1st bwplot
bwplot(x~y, ylab='Size', xlab='Value',
probs=seq(.01,.49,by=.01),datadensity=TRUE, panel = function(...) {
           panel.grid(v = -1, h = 0)
    	 panel.bpplot(means=TRUE,...)
             }
       )

#2nd bwplot
bwplot(x~y, ylab='Size', xlab='Value',ylim=c('Large','Medium'),
probs=seq(.01,.49,by=.01),datadensity=TRUE, panel = function(...) {
           panel.grid(v = -1, h = 0)
      	 panel.bpplot(means=TRUE,...)
             }
       )



--
View this message in context: http://r.789695.n4.nabble.com/label-the-mean-in-bwplot-and-divide-a-panel-in-two-plots-tp4660728.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list