# NOT RUN {
# Use `sza` to create a gt table; color
# the `sza` column using the `data_color()`
# function, then, add a footnote to the
# `sza` column label explaining what the
# color scale signifies
tab_1 <-
sza %>%
dplyr::filter(
latitude == 20 &
month == "jan" &
!is.na(sza)
) %>%
dplyr::select(-latitude, -month) %>%
gt() %>%
data_color(
columns = vars(sza),
colors = scales::col_numeric(
palette = c("white", "yellow", "navyblue"),
domain = c(0, 90))
) %>%
tab_footnote(
footnote = "Color indicates height of sun.",
locations = cells_column_labels(
columns = vars(sza))
)
# }
Run the code above in your browser using DataLab