# NOT RUN {
# Use `gtcars` to create a gt table; add
# a footnote that targets a single data cell
# with `tab_footnote()`, using `cells_body()`
# in `locations` (`rows = hp == max(hp)` will
# target a single row in the `hp` column)
tab_1 <-
gtcars %>%
dplyr::filter(ctry_origin == "United Kingdom") %>%
dplyr::select(mfr, model, year, hp) %>%
gt() %>%
tab_footnote(
footnote = "Highest horsepower.",
locations = cells_body(
columns = vars(hp),
rows = hp == max(hp))
) %>%
opt_footnote_marks(marks = c("*", "+"))
# }
Run the code above in your browser using DataLab