# 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 = c(
country_code_2,
country_code_3
)
)
# If the `tab_1` object is provided without
# the code or source data to regenerate it, and,
# the user wants to reveal otherwise hidden
# columns then the `cols_unhide()` function
# becomes useful
tab_2 <-
tab_1 %>%
cols_unhide(columns = country_code_2)
# }
Run the code above in your browser using DataLab