powered by
Retrieves COVID-19 totals for a given country using the 'disease.sh' API.
get_covid_stats_by_country_name( country, yesterday = FALSE, twoDaysAgo = FALSE, strict = TRUE, allowNull = FALSE )
A data frame with the following columns:
country: Country name.
country
updated: Timestamp of last update (POSIXct in UTC).
updated
cases: Total confirmed cases.
cases
todayCases: New confirmed cases today.
todayCases
deaths: Total deaths.
deaths
recovered: Total recoveries.
recovered
population: Estimated population.
population
Character. A country name, ISO2, ISO3 code, or country ID.
Logical. If TRUE, gets data reported from the previous day. Default is FALSE.
TRUE
FALSE
Logical. If TRUE, gets data reported two days ago. Default is FALSE.
Logical. If TRUE (default), disables fuzzy matching (e.g., avoids confusion between "Oman" and "Romania").
Logical. If TRUE, allows null values (returned as NA). Default is FALSE.
NA
This function accesses COVID-19 data for a specific country based on its name or ISO code.
API Docs: https://disease.sh/docs/#/COVID-19
# \donttest{ # Get data for Brazil get_covid_stats_by_country_name("Brazil") # Get data for the USA using ISO2 code get_covid_stats_by_country_name("US", yesterday = TRUE) # }
Run the code above in your browser using DataLab