smooth_pre_process: Pre process smoothing

View source: R/plotting_functions.R

smooth_pre_processR Documentation

Pre process smoothing

Description

Function pre-processes data for sending to smoothing function

Usage

smooth_pre_process(
  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

named list containing x,y,and k, which can be fed to smooth_dt

Examples

smooth_pre_process(brazil)

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