Plot predicted versus observed counts
plot_counts_pred_obs(
pred.df = NULL,
data = NULL,
byplant = FALSE,
width = 0.95,
...
)
A data frame containing the predicted counts, as generated by
predict_counts()
Data list (from prepare_data()
)
Logical. If TRUE, show predicted and observed counts per plant
(using ggplot2::facet_wrap()
). If FALSE, show all interactions in the same plot.
width of the credible interval (default = 0.95).
Further arguments to be passed to ggplot2::facet_wrap()
if
byplant = TRUE
, or to tidybayes::geom_pointinterval()
if byplant = FALSE
.
A ggplot object
if (FALSE) { # interactive()
data(web)
dt <- prepare_data(mat = web, sampl.eff = rep(20, nrow(web)))
fit <- fit_model(dt, refresh = 0)
pred.df <- predict_counts(fit, dt)
plot_counts_pred_obs(pred.df, dt)
plot_counts_pred_obs(pred.df, dt, fatten_point = 3)
plot_counts_pred_obs(pred.df, dt, byplant = TRUE)
plot_counts_pred_obs(pred.df, dt, byplant = TRUE, scale = "free")
}