get_plot_data: Returns the subset of data for a specific plot

Description Usage Arguments Value Examples

View source: R/plotting_functions.R

Description

This function prepares the subset of data that will be fed to the base plotting function

Usage

1
2
3
4
5
6
7
8
9
get_plot_data(
  dt,
  outcome,
  geo_level,
  state = NULL,
  cumulative = F,
  per100K = F,
  popsize = NULL
)

Arguments

dt

dataframe prepared using the prepare_plot_datasets() function

outcome

character string, one of "Cases" or "Deaths"

geo_level

character string, one of "us", "state", "county"

state

defaults to NULL, but if geo_level is "state", should be two-character state abbreviation

cumulative

defaults to FALSE (and daily outcome is plotted), but can be TRUE for cumulative results

per100K

currently not implemented (FALSE)

popsize

currenlty not implemented (NULL)

Value

Returns a list including the subset of data (plot_data), the location (location), the outcome, and whether or not the data are cumulative or not

Examples

1
2
get_plot_data(dt=prepared_data_frame, outcome="Cases", geo_level="us", state=NULL, cumulative=F)
get_plot_data(dt=prepared_data_frame, outcome="Deaths", geo_level="state", state="TX", cumulative=T)

lmullany/iddplotting documentation built on July 26, 2020, 8:05 p.m.