plot_spec: Create a line chart presenting specific country/countries...

Description Usage Arguments Value Examples

View source: R/plot_spec.R

Description

Create a line chart presenting specific country/countries COVID information within a time period

Usage

1
2
3
4
5
6
7
8
plot_spec(
  df,
  location = c("Canada"),
  val = c("new_cases"),
  date_from = NULL,
  date_to = NULL,
  title = NULL
)

Arguments

df

Data frame of the selected covid data from get_data()

location

Charactor vector of target country names. By default c('Canada)

val

Quantitative values to be aggregated. Must be numeric variable. Also known as a 'measure'. By default 'new_cases'

date_from

Start date of the data range with format like '2021-10-31'. By default 'NULL' is used to represent 7 days prior to today's date

date_to

End date of data range with format like '2021-10-31'. By default 'NULL' is used to represent 7 days prior to today's date

title

The title of the plot. By default will be generated based on val

Value

A ggplot line chart

Examples

1
2
df <- get_data(date_from = "2022-01-01", date_to = "2022-01-07")
plot_spec(df, date_from = "2022-01-01", date_to = "2022-01-07", location = c("Canada", "Turkey"))

UBC-MDS/covizr documentation built on Feb. 7, 2022, 9:11 a.m.