Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stat_confidence_densityh() #1

Open
SchmidtPaul opened this issue Sep 17, 2021 · 0 comments
Open

stat_confidence_densityh() #1

SchmidtPaul opened this issue Sep 17, 2021 · 0 comments

Comments

@SchmidtPaul
Copy link

Hi, I am very intrigued by the idea of having confidence strips. However, I will probably use them vertically and would like to know whether you plan on adding stat_confidence_densityh(). Technically stat_confidence_density() is already horizontal and could be renamed stat_confidence_densityh() if the vertical counterpart stat_confidence_density() was added.

Otherwise I know that I could always make use of cord_flip() but I simply wanted to ask here first.
Sorry if I am missing some obvious answer here

library(emmeans)
library(tidyverse)
library(ungeviz)

# Setup
my_means <- PlantGrowth %>% 
  lm(weight ~ group, data = .) %>% 
  emmeans("group") %>% 
  as_tibble()

# Horizontal
ggplot(my_means,
       aes(
         y = group,
         x = emmean,
         xmin = lower.CL,
         xmax = upper.CL,
         moe = SE
       )) +
  stat_confidence_density(fill = "lightblue",
                          height = 0.2,
                          confidence = 0.95) +
  geom_point() +
  geom_errorbarh(height = 0.1) +
  theme_minimal()

# Vertical
ggplot(my_means,
       aes(
         x = group,
         y = emmean,
         ymin = lower.CL,
         ymax = upper.CL,
         moe = SE
       )) +
  # stat_confidence_densityh(fill = "lightblue",
  #                          height = 0.2,
  #                          confidence = 0.95) +
  geom_point() +
  geom_errorbar(width = 0.1) +
  theme_minimal()

Created on 2021-09-17 by the reprex package (v2.0.0)

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

No branches or pull requests

1 participant