View source: R/posterior-methods.R
plot.fv_posterior | R Documentation |
plot
method for class "fv_posterior". This function wraps all
lower level plot functions.
## S3 method for class 'fv_posterior'
plot(
x,
obs = NULL,
type = "cases",
forecast_dates = NULL,
central = FALSE,
all_obs = FALSE,
voc_label = "variant of concern",
...
)
x |
A |
obs |
A data frame of observed data as produced by |
type |
A character string indicating the type of plot required,
defaulting to "cases". Current options are: "cases" which calls
|
forecast_dates |
A data.frame in the format produced by
|
central |
Logical, defaults to FALSE. Should the mean and median
central estimates be plot as dashed and solid lines respectively. Requires
|
all_obs |
Logical, defaults to |
voc_label |
Character string giving the name to assign to the variant of concern. Defaults to "variant of concern". |
... |
Pass additional arguments to lower level plot functions. |
ggplot2
object
Functions used for postprocessing of model fits
convert_to_stanfit()
,
extract_draws()
,
extract_forecast_dates()
,
fv_extract_forecast()
,
fv_posterior()
,
fv_tidy_posterior()
,
link_dates_with_posterior()
,
link_obs_with_posterior()
,
print.fv_posterior()
,
quantiles_to_long()
,
summary.fv_posterior()
,
update_voc_label()
Plotting functions
add_forecast_dates()
,
plot.fv_forecast()
,
plot_cases()
,
plot_default()
,
plot_growth()
,
plot_pairs()
,
plot_posterior()
,
plot_rt()
,
plot_theme()
,
plot_voc_advantage()
,
plot_voc_frac()
,
save_plots()
posterior <- fv_example(strains = 2, type = "posterior")
# plot cases on the log scale
plot(posterior, type = "cases", log = TRUE)
# plot cases with central estimates
plot(posterior, type = "cases", log = FALSE, central = TRUE)
# plot fraction that have the variant of concern
plot(posterior, type = "voc_frac")
# plot the transmission advantage for the the variant of concern
plot(posterior, type = "voc_advantage")
# plot the growth rates for both voc and non-voc cases
plot(posterior, type = "growth")
# plot the reproduction number estimates
plot(posterior, type = "rt")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.