Skip to content

Extra pointrange and errorbar support#40

Merged
grantmcdermott merged 5 commits intomainfrom
pointrange-xaxis
Jun 25, 2023
Merged

Extra pointrange and errorbar support#40
grantmcdermott merged 5 commits intomainfrom
pointrange-xaxis

Conversation

@grantmcdermott
Copy link
Owner

@grantmcdermott grantmcdermott commented Jun 20, 2023

Closes #38. Also closes #39.

Examples:

library(plot2)
par(pch = 19)

mod = lm(mpg ~ hp + factor(cyl), mtcars)
coefs = data.frame(names(coef(mod)), coef(mod), confint(mod))
coefs = setNames(coefs, c("x", "y", "ymin", "ymax"))

with(
  coefs,
  plot2(
    x = x,
    y = y,
    ymin = ymin,
    ymax = ymax,
    type = "pointrange"
  )
)

with(
  coefs,
  plot2(
    x = x,
    y = y,
    ymin = ymin,
    ymax = ymax,
    type = "errorbar"
  )
)

Created on 2023-06-19 with reprex v2.0.2

@grantmcdermott
Copy link
Owner Author

I know everyone is busy with impending travels etc. and I'm pretty confident that this PR is good to go. So I'm happy to merge this as is, but please feel free to ping if you spot something problematic.

@grantmcdermott grantmcdermott merged commit e6deefa into main Jun 25, 2023
@grantmcdermott grantmcdermott deleted the pointrange-xaxis branch June 25, 2023 23:01
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.

Support type = "errorbar" Support pointrange character / factor x-axis

1 participant