View source: R/panel.groups.segplot.R
panel.groups.segplot | R Documentation |
segplot()
This function allows non overlapping error bars in
latticeExtra::segplot()
. It has the groups =
argument.
panel.groups.segplot(
x,
y,
z,
centers,
groups,
gap = NULL,
data,
subscripts,
...
)
x , y , z , centers , data , subscripts , ... |
Arguments passed to
|
groups |
The grouping variable ( |
gap |
Scalar that is the distance among segments. Default is
0.1. If the grouping factor has |
Walmes Zeviani, walmes@ufpr.br.
segplot()
.
library(latticeExtra)
m0 <- lm(log(breaks) ~ wool * tension, data = warpbreaks)
pred <- with(warpbreaks, expand.grid(KEEP.OUT.ATTRS = TRUE,
wool = levels(wool),
tension = levels(tension)))
pred <- cbind(pred,
predict(m0, newdata = pred, interval = "confidence"))
str(pred)
segplot(wool ~ lwr + upr, centers = fit, data = pred,
draw = FALSE, horizontal = FALSE)
segplot(wool ~ lwr + upr, centers = fit, data = pred,
draw = FALSE, horizontal = FALSE,
groups = tension, gap = 0.05,
panel = panel.groups.segplot)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.