smooth_outcome: Get a smoothed outcome

View source: R/plotting_functions.R

smooth_outcomeR Documentation

Get a smoothed outcome

Description

Function is a wrapped around smooth_pre_process and smooth_dt

Usage

smooth_outcome(
  dt,
  xvar = "Date",
  yvar = "Confirmed",
  knot_interval = 21,
  family = c("poisson", "gaussian")
)

Arguments

dt

data frame containing the data to be smoothed

xvar

string name of column in dt containing xvar, default is "Date"

yvar

string name of column in dt containng yvar, default is "Confirmed"

knot_interval

how frequently should the nots be placed? default is 21, which in the case of plotting daily covid data, represents one knot every 3 weeks

family

string indicating family, must be either "poisson" (default) or "gaussian"

Value

vector of smoothed predictions

Examples

smooth_outcome(brazil)

lmullany/rawcoviddata documentation built on March 21, 2023, 10:04 a.m.