Description Usage Arguments Examples
Visualize disease statistics on a day-by-day basis
1 2 | plotTimeSeries(data, plot_what = "cases", group = "all",
x_axis = "date")
|
data |
disease data to plot (usually the output of filterDiseaseData) |
plot_what |
options are: "cases" (default), "recovered", "deaths" (plots totals by date), "log_cases", "log_recovered", "log_deaths" (plots natural log of totals by date), "x_per_y" where x and y are either "cases", "recovered", "deaths", or "pop" (plots the ratio by date), "new_cases", "new_recovered", "new_deaths" (plots change by date) or "growth_factor" (plots new cases divided by new cases on previous date for each date) |
group |
options are: "province", "region", or "all" ("all" is the default). "province" creates one plot layer for each province in the data, "region" creates one plot layer for each region in the data, "all" creates one plot layer total |
x_axis |
options are "date" ("date" is the default) or "day_of_disease". "date" makes the x-axis the calendar date, "day_of_disease" makes the x-axis the days since the 100th case in the group (where group is specified in the group argument) |
1 2 3 4 5 6 7 8 9 10 | covid_data <- importCovidData()
us_covid_data <- filterDiseaseData(covid_data, country = "US")
us_italy_covid_data <- filterDiseaseData(covid_data, country = c("US", "Italy"))
plotTimeSeries(us_covid_data, plot_what = "cases") # will plot US cases
plotTimeSeries(us_italy_covid_data, group = "all") # will plot aggregate US & Italy cases
plotTimeSeries(us_italy_covid_data,plot_what="log_cases",group="region",x_axis="day_of_disease")
# will have one layer for log of US cases, another for log of Italy cases
plotTimeSeries(us_covid_data, plot_what = "deaths_per_cases")
plotTimeSeries(us_covid_data, plot_what = "new_deaths")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.