billboarder icon indicating copy to clipboard operation
billboarder copied to clipboard

Scatterplot in which the grouping variable takes more than 4 different values does not work

Open lukr90 opened this issue 4 years ago • 2 comments

Example from Documentation with grouping by cyl works. cyl takes three different values 4 6 and 8

billboarder(data = mtcars) %>% 
  bb_scatterplot(
   mapping = aes(wt, mpg, group = cyl, size = scales::rescale(qsec, to = c(0.2, 7))),
   point_opacity = 1
  ) %>% 
  bb_axis(x = list(tick = list(fit = FALSE))) %>% 
  bb_x_grid(show = TRUE) %>%
  bb_y_grid(show = TRUE)

whereas grouping by carb does not work. carb takes six different values 1 2 3 4 6 and 8

billboarder(data = mtcars) %>% 
    bb_scatterplot(
        mapping = aes(wt, mpg, group = carb, size = scales::rescale(qsec, to = c(0.2, 7))),
        point_opacity = 1
    ) %>% 
    bb_axis(x = list(tick = list(fit = FALSE))) %>% 
    bb_x_grid(show = TRUE) %>%
    bb_y_grid(show = TRUE)

lukr90 avatar Mar 29 '22 10:03 lukr90

Hello, Thanks for reporting this. That's a bug due to groups of length one (carb == 6 or carb == 8). That's fixed if you re-install from GitHub.

Victor

pvictor avatar Mar 31 '22 07:03 pvictor

Thanks!!

lukr90 avatar Mar 31 '22 12:03 lukr90