# NOT RUN {
# Use `pizzaplace` to create a gt table;
# add a stubhead label and then style it
# with `tab_style()` and `cells_stubhead()`
tab_1 <-
pizzaplace %>%
dplyr::mutate(month = as.numeric(substr(date, 6, 7))) %>%
dplyr::group_by(month, type) %>%
dplyr::summarize(sold = dplyr::n()) %>%
dplyr::ungroup() %>%
dplyr::filter(month %in% 1:2) %>%
gt(rowname_col = "type") %>%
tab_stubhead(label = "type") %>%
tab_style(
style = cell_fill(color = "lightblue"),
locations = cells_stubhead()
)
# }
Run the code above in your browser using DataLab