# NOT RUN {
# Use `countrypops` to create a gt table;
# Hide the columns `country_code_2` and
# `country_code_3`
tab_1 <-
countrypops %>%
dplyr::filter(country_name == "Mongolia") %>%
tail(5) %>%
gt() %>%
cols_hide(
columns = vars(
country_code_2, country_code_3)
)
# Use `countrypops` to create a gt table;
# Use the `population` column to provide
# the conditional placement of footnotes,
# then hide that column and one other
tab_2 <-
countrypops %>%
dplyr::filter(country_name == "Mongolia") %>%
tail(5) %>%
gt() %>%
cols_hide(
columns = vars(country_code_3, population)
) %>%
tab_footnote(
footnote = "Population above 3,000,000.",
locations = cells_body(
columns = vars(year),
rows = population > 3000000)
)
# }
Run the code above in your browser using DataLab