View source: R/expected_plot.R
expected_plot | R Documentation |
Check if expected counts fit data
expected_plot(
expected,
title = "",
start = NULL,
end = NULL,
ylim = NULL,
weekly = FALSE,
color = "#3366FF",
alpha = 0.5
)
expected |
The output from 'compute_expected' |
title |
A title to add to plot |
start |
First day to show |
end |
Last day to show |
ylim |
A vector with two numbers that determines the kimits for the y-axis |
weekly |
Logical that determines if data should be summarized into weekly counts |
color |
Color for the expected curve |
alpha |
alpha blending for points |
A ggplot object containing a plot of the original counts and the estimated expected values.
data(new_jersey_counts)
exclude_dates <- as.Date("2012-10-29") + 0:180
e <- compute_expected(new_jersey_counts, exclude = exclude_dates, weekday.effect = TRUE)
library(ggplot2)
expected_plot(e, start = as.Date("2012-09-01"), end = as.Date("2013-09-01"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.