[R] how to add a vertical line for each panel in a lattice dotplot with log scale?

maxbre mbressan at arpa.veneto.it
Wed Jun 6 14:10:11 CEST 2012


by considering this example from barley dataset

#code start

dotplot(variety ~ yield | site, data = barley,
        scales=list(x=list(log=TRUE)),
        layout = c(1,6),
        panel = function(...) {
        panel.dotplot(...)
        #median.values <- tapply(x, y, median)            # medians for each
variety
        #panel.abline(v=median.values, col.line="red")    # but this is not
working!
        #panel.curve(...)                                 # how to properly
set this?
        }
        )

#code end

I want to plot as a reference vertical line the medians for each panel

I’ve been reading in 
https://stat.ethz.ch/pipermail/r-help/2009-January/185384.html 
that it’s not possible with panel.abline() and it’s probably necessary to
use panel.curve() instead; unfortunately I can’t figure (manage) how, any
help for this?

thank you




--
View this message in context: http://r.789695.n4.nabble.com/how-to-add-a-vertical-line-for-each-panel-in-a-lattice-dotplot-with-log-scale-tp4632513.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list