View source: R/get_global_covid_stats.R
get_global_covid_stats | R Documentation |
Retrieves real-time global statistics on COVID-19 from the 'disease.sh' API.
get_global_covid_stats()
This function sends a GET request to the 'disease.sh' API and parses the returned JSON into a structured and user-friendly data frame. The timestamp is converted to a readable date-time format (in UTC).
A data frame with the following columns:
updated
: Last updated time (as a human-readable date-time).
cases
: Total confirmed cases worldwide.
todayCases
: Number of new confirmed cases today.
deaths
: Total confirmed deaths worldwide.
recovered
: Total number of recovered patients.
todayRecovered
: Number of recovered patients today.
active
: Current active cases.
critical
: Current number of critical cases.
tests
: Total number of tests performed.
population
: Estimated global population.
affectedCountries
: Number of countries affected.
An internet connection is required to use this function.
API Docs: https://disease.sh/docs/#/COVID-19
global_stats <- get_global_covid_stats()
print(global_stats)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.