Skip to content

stat_summary error when missing ymin/ymax in facet #1445

Closed
@tpall

Description

@tpall

stat_summary gives error with ggplot2_2.0.0 when missing data for ymin/ymax in at least one facet to calculate errorbars/pointrange.
ggplot2 1.0.1 robustly plotted just points without bars in such facet.

Taavi

Minimal example:

library(ggplot2)
library(dplyr)
mtcars %>% 
   group_by(gear, cyl) %>%
   summarise(hp = mean(hp)) %>%
   ggplot(aes(gear, hp)) + 
   stat_summary(fun.data = mean_se, geom = "pointrange") +
   facet_wrap(~cyl)
Error in FUN(X[[i]], ...) : subscript out of bounds
In addition: Warning message:
Removed 8 rows containing missing values (geom_pointrange). 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions