problem of display ggplot2 result

Hi Team,
I was able to run the following testing code to get half/half plot on R 4.2.1 . But after I upgrade the R to 4.2.2, the last row of plot(hh) generate error messages:

Bin width defaults to 1/30 of the range of the data. Pick better value with binwidth.
Error in geom_half_boxplot():
! Problem while converting geom to grob.
:information_source: Error occurred in the 1st layer.
Caused by error in data.frame():
! arguments imply differing number of rows: 1, 0
Run rlang::last_error() to see where the error occurred.
Warning messages:
***1: Removed 9 rows containing non-finite values (stat_boxplot()). ***
2: Removed 9 rows containing non-finite values (stat_half_bindot()).

the all packages in the code are all up to date. Does anyone know what the reason for the problem? and how to solve the problem?

mytest2 <- trial %>% filter( stage != "T1")

hh <-
mytest2 %>%

  ggplot(aes(grade, age, color = grade)) +

  geom_half_boxplot(outlier.color = "red") +
    aes(fill =grade),
    dotsize = 0.75,
    stackratio = 0.5 ,
    color = "black"
  ) +

  scale_color_tq() +
  scale_fill_tq() +
  theme_tq() +
    title = "",
    subtitl = "half-Boxplot + half-Dotplot"


I recommend that you raise this issue at this venue : Issues · erocoar/gghalves (

This topic was automatically closed 42 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.