View source: R/get_covid_stats_by_country.R
get_covid_stats_by_country | R Documentation |
Retrieves real-time COVID-19 totals for all countries from the 'disease.sh' API.
get_covid_stats_by_country(
yesterday = FALSE,
twoDaysAgo = FALSE,
sort = NULL,
allowNull = FALSE
)
yesterday |
Logical. If |
twoDaysAgo |
Logical. If |
sort |
Character. Field to sort results by. Options include: |
allowNull |
Logical. If |
This function fetches COVID-19 summary statistics for each country. Useful for global surveillance or international comparisons.
A data frame containing:
country
: Country name.
updated
: Last updated timestamp (as POSIXct in UTC).
cases
: Total confirmed cases.
todayCases
: New confirmed cases today.
deaths
: Total deaths.
todayDeaths
: New deaths today.
population
: Population estimate for each country.
Requires internet access.
API Docs: https://disease.sh/docs/#/COVID-19
# Get real-time COVID-19 data for all countries
get_covid_stats_by_country()
# Get sorted data by number of deaths reported yesterday
get_covid_stats_by_country(yesterday = TRUE, sort = "deaths")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.