So I never heard of ggblanket
, and I never used gghighlight
. However, if I assign the plot call to a variable (omitting the gghighlight chunk) and do summary
:
library(tidyverse)
library(ggblanket)
library(gghighlight)
p = count(mtcars, carb) %>%
ggblanket::gg_col(x = carb, y = n)
#> ℹ For further ggblanket information, see https://davidhodge931.github.io/ggblanket/
#> This message is displayed once every 8 hours.
#> Warning in ggplot2::geom_col(stat = stat, position = position, alpha = alpha, :
#> Ignoring unknown parameters: `stat`
summary(p)
#> data: carb, n [6x2]
#> mapping: x = ~carb, y = ~n, colour = , fill = , group = NULL
#> scales: x, xmin, xmax, xend, xintercept, xmin_final, xmax_final, xlower, xmiddle, xupper, x0, y, ymin, ymax, yend, yintercept, ymin_final, ymax_final, lower, middle, upper, y0, colour, fill
#> faceting: <ggproto object: Class FacetNull, Facet, gg>
#> compute_layout: function
#> draw_back: function
#> draw_front: function
#> draw_labels: function
#> draw_panels: function
#> finish_data: function
#> init_scales: function
#> map_data: function
#> params: list
#> setup_data: function
#> setup_params: function
#> shrink: TRUE
#> train_scales: function
#> vars: function
#> super: <ggproto object: Class FacetNull, Facet, gg>
#> -----------------------------------
#> geom_col: just = 0.5, width = NULL, na.rm = FALSE
#> stat_identity: na.rm = FALSE
#> position_stack
This line stuck out to me. Notice the blank colour and fill. My assumption is that this is not playing well with gghighlight
#> mapping: x = ~carb, y = ~n, colour = , fill = , group = NULL
Therefore, if we supply a variable in the col argument for gg_col
, then this works. Perhaps this is a bug/enhancement for ggblanket
?
library(tidyverse)
library(ggblanket)
library(gghighlight)
count(mtcars, carb) %>%
ggblanket::gg_col(x = carb, y = n, col = carb) +
gghighlight::gghighlight(carb == 8)
#> Warning in ggplot2::geom_col(stat = stat, position = position, alpha = alpha, :
#> Ignoring unknown parameters: `stat`
Created on 2023-01-04 by the reprex package (v2.0.1)