Skip to content

Conversation

@grantmcdermott
Copy link
Owner

Fixes #519

(Follow up to #517)

pkgload::load_all("~/Documents/Projects/tinyplot")
#> ℹ Loading tinyplot

models = list(
    "Model A" = lm(mpg ~ cyl, data = mtcars),
    "Model B" = lm(mpg ~ hp + cyl, data = mtcars)
)

results = lapply(names(models), function(m) {
    data.frame(
        model = m,
        term = names(coef(models[[m]])),
        estimate = coef(models[[m]]),
        setNames(data.frame(confint(models[[m]])), c("conf.low", "conf.high"))
    )
})
results = do.call(rbind, results)

tinyplot(estimate ~ term | model,
         ymin = conf.low, ymax = conf.high,
         data = results,
         type = "pointrange",
        #  dodge = 0.1,
         theme = "basic")
tinyplot_add(type = "l")

Created on 2025-11-21 with reprex v2.1.1

@grantmcdermott grantmcdermott merged commit a2913e9 into main Nov 21, 2025
3 checks passed
@grantmcdermott grantmcdermott deleted the issue519 branch November 21, 2025 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Layering alignment gotcha: lines on top of grouped errorbars

2 participants