Skip to contents

Table for displaying top 10's.

Usage

table_10vaccinations(
  df,
  vac_type = c("People", "Fully", "Booster"),
  type = "Global",
  run_date = "Enter a date"
)

Arguments

df

A dataframe with the following and in this order: country, value1 - people vaccinated per 100, value2 - daily vaccines administered per 100 people, date

vac_type

(character, default: "Partial") one of "Partial", "Fully" depending on vaccination status being tabulated

type

(character, default: "Global") Text name for subset of data df is, to be included in title

run_date

(character, default: "Enter a date") Run date to include in table source

Examples

if (FALSE) {
sunday_date <- lubridate::floor_date(Sys.Date(), "week", week_start = 7)
df_who <- get_combined_table("WHO")

# Take global data for countries with population > 1,000,000
df_who %>%
  filter(date <= sunday_date, population > 1000000) %>%
  group_by(country) %>%
  filter(!is.na(people_fully_vaccinated_per_hundred)) %>%
  filter(date == max(date)) %>%
  ungroup() %>%
  select(country = who_country, value1 = people_fully_vaccinated_per_hundred, value2 = daily_vaccinations_per_hundred) %>%
  arrange(desc(value1)) %>%
  head(10) %>%
  table_10vaccinations(., run_date = format(sunday_date, "%B %d, %Y"))
}