This models wraps ggplot2 commands into a standard form for making cyclical trend line plots of influenza. Developed only for convenience, the authors encourage individuals to make their own customized graphs as appropriate.
fluplot(data = NULL, xvar = NULL, yvar = NULL, baseline = y0, threshold = y0_ul, linenames = NULL, ylab = "[OUTCOME]", title = "[INSERT TITLE]")
data | A dataframe class object, must contain time variable, outcome variable |
---|---|
xvar | x-axis variable, must be date class |
yvar | y-axis, outcome variable |
baseline | second line variable, fitted cyclical trend. Default="y0". |
threshold | third line, upper threshold for cyclical trend. Default="y0_ul". |
linenames | Defaults specified, but can override. Must be character vector of length=3. |
ylab | Character vector for Y-axis label |
title | Character vector for Plot Title |
an object of class gg, ggplot.
require(flumodelr) fludta <- flumodelr::fludta flu_fit <- fluserf(fludta, outc = fludeaths, time = yrweek_dt) fluplot(flu_fit, xvar=yrweek_dt, yvar=fludeaths)