View source: R/type_errorbar.R
type_errorbar | R Documentation |
Type function(s) for producing error bar and pointrange plots.
type_errorbar(length = 0.05)
type_pointrange()
length |
length of the edges of the arrow head (in inches). |
mod = lm(mpg ~ wt * factor(am), mtcars)
coefs = data.frame(names(coef(mod)), coef(mod), confint(mod))
colnames(coefs) = c("term", "est", "lwr", "upr")
op = tpar(pch = 19)
# "errorbar" and "pointrange" type convenience strings
with(
coefs,
tinyplot(x = term, y = est, ymin = lwr, ymax = upr, type = "errorbar")
)
with(
coefs,
tinyplot(x = term, y = est, ymin = lwr, ymax = upr, type = "pointrange")
)
# Use `type_errorbar()` to pass extra arguments for customization
with(
coefs,
tinyplot(x = term, y = est, ymin = lwr, ymax = upr, type = type_errorbar(length = 0.2))
)
tpar(op)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.