query4 | R Documentation |
This is a more flexible query - essentially, a user can specify a time frame, then investigate any variable of their choice.
query4( plot_type = "static", start = "outbreak_start", end = "most_recent", var = "new_cases", func = "sum", projection = "mercator", palette = "YlOrBr" )
plot_type |
"static" | "dynamic" |
start |
The start date of the time frame; this can be specified with one of the following:
|
end |
The end date of the time frame; this can be specified with one of the following:
|
var |
"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 |
func |
"sum" | "mean" | "median" | "min" | "max" |
projection |
"mercator" | "globular" | "gilbert" |
palette |
"YlOrBr" or any sequential palette from RColorBrewer: "YlOrRd", "YlOrBr", "YlGnBu", "YlGn", "Reds", "RdPu", "Purples", "PuRd", "PuBuGn", "PuBu", "OrRd", "Oranges", "Greys", "Greens", "GnBu", "BuPu", "BuGn", "Blues". |
Either a static map produced with ggplot2 or a dynamic one produced with leaflet.
query4(plot_type = "static", start = "outbreak_start", end = "most_recent", var = "new_cases", func = "sum", projection = "mercator") query4(plot_type = "dynamic", start = c("new_deaths" = 1000), end = "04-33-2021", var = "new_vaccinations", func = "median", projection = "gilbert") query4(plot_type = "dynamic", start = "03-03-2020", end = c("population" = 30000), var = "new_cases", func = "max", projection = "globular")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.