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)
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)
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)
}
setTrellis()
Dotplot(name ~ Cbind(mean,lo,up) | cond1 * cond2, data=d, ylab="", xlab="",col=1,
panel = mypanel.Dotplot)
