Error icons: | --o | | do not draw more than three conditions in dotplot

This question is an unexpected continuation. Draw the vertical line ending of the error line in dotplot . Although the quoted issue has been successfully resolved, there is a reservation. When I introduced more than three conditions for truncation, he does not want to draw vertical ticks | --o-- | at the end of the error line.

As @Josh explained in the comments, I entered browser()the first line of the function, which draws the updated one panel.Dotplot, in order to understand what would go wrong, but this did not get anything that helped me solve it. Here is sample code for four conditions Dotplot()with an updated function panel.Dotplotthat doesn't work. It will work if you reduce the number of conditions (check the answer to the question above):

require(Hmisc)
#Fake conditions
mean = c(1:18)
lo = mean-0.2
up = mean+0.2
name = c("a","b","c")
cond1 = c("A","B","C")
cond2 = c(rep("E1",9),rep("E2",9))
d = data.frame (name = rep(name,6), mean, lo, up, 
                cond1=rep(cond1,each=3,times=2), cond2)
# Create the customized panel function
mypanel.Dotplot <- function(x, y, ...) {
       panel.Dotplot(x,y,...)
       tips <- attr(x, "other")
       panel.arrows(x0 = tips[,1], y0 = y,x1 = tips[,2], 
                y1 = y,length = 0.1, unit = "native",
                angle = 90, code = 3)
}
#Draw Dotplot - `panel.Dotplot` doesn't change anything
setTrellis()
Dotplot(name ~ Cbind(mean,lo,up) | cond1 * cond2, data=d, ylab="", xlab="",col=1,
        panel = mypanel.Dotplot)

enter image description here

+5
1

, - (± 0,2 ). ± 1 ( length, panel.arrows - - 0,5):

lattice error bars

x, ( ) , x. , ± 0,2 , length 0,1:

Dotplot(name ~ Cbind(mean,lo,up) | cond1 * cond2, data=d, ylab="", xlab="",
  col=1, panel = mypanel.Dotplot, pch=20, cex=0.4, layout=c(1, 6), strip=FALSE,
  strip.left=strip.custom(par.strip.text=list(cex=0.75), bg=0, fg=0))

lattice precise error bars

+5

All Articles