Description Usage Arguments Author(s) See Also Examples
View source: R/panel.groups.segplot.R
This function allows non overlapping error bars in
latticeExtra::segplot()
. It has the groups =
argument.
1 2 3 4 5 6 7 8 9 10 11 | 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 k levels, so 0 ≤q
\textrm{gap} < 1/k. A negative value for |
Walmes Zeviani, walmes@ufpr.br.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | 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.