query6 | R Documentation |
Produces a scatterplot of any two numeric variables from the OWID COVID dataset. Can subset dataset by specifying one or more countries, a time frame; if dataset is large, apply binning.
query6( plot_type = "static", x = "new_cases", y = "new_deaths", country = "United States", start = NULL, end = NULL, use_bins = FALSE )
plot_type |
"static" | "dynamic" |
x |
"new_cases" | "new_deaths" | "new_vaccinations" - or any other numeric variable in the OWID COVID dataset found here: https://covid.ourworldindata.org/data/owid-covid-data.csv |
y |
Any numeric variable other than x. |
country |
"United States" | "Canada" | "United Kingdom" - or any other country name. |
start |
The start date of the time frame; by default (NULL) starts from the first available record in the OWID COVID dataset. Or specify any date string in the format "%m-%d-%Y" such as "05-22-2020". |
end |
The end date of the time frame; by default (NULL) includes the most recent record in the OWID COVID dataset. Or specify any date string in the format "%m-%d-%Y" such as "07-22-2021". |
use_bins |
TRUE | FALSE - apply binning on the points? |
Either a static plot produced with ggplot2 or a dynamic one produced with plotly.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.