11# ' Plot `seroincidence.by` log-likelihoods
22# ' @description
33# ' Plots log-likelihood curves by stratum, for `seroincidence.by` objects
4- # ' @param object a '"seroincidence.by"' object (from [estimate_scr_by ()])
4+ # ' @param object a '"seroincidence.by"' object (from [est_seroincidence_by ()])
55# ' @param ncol number of columns to use for panel of plots
66# ' @inheritDotParams autoplot.seroincidence
7- # ' @return an object of class `"ggarrange"`, which is a [ggplot2::ggplot()] or a [list()] of [ggplot2::ggplot()]s.
7+ # ' @return a `"ggarrange"` object: a single or [list()] of [ggplot2::ggplot()]s
88# ' @export
99# ' @examples
1010# '\donttest{
2121# ' noise <-
2222# ' example_noise_params_pk
2323# '
24- # ' est2 <- estimate_scr_by (
24+ # ' est2 <- est_seroincidence_by (
2525# ' strata = c("catchment"),
2626# ' pop_data = xs_data,
2727# ' curve_params = curve,
3636# ' # Plot the log-likelihood curve
3737# ' autoplot(est2)
3838# '}
39- autoplot.seroincidence.by = function (
39+ autoplot.seroincidence.by <- function (
4040 object ,
4141 ncol = min(3 , length(object )),
4242 ... ) {
@@ -47,16 +47,15 @@ autoplot.seroincidence.by = function(
4747 if (! attr(object , " graphs_included" )) {
4848 stop(
4949 " Graphs cannot be extracted; " ,
50- " `build_graph` was not `TRUE` in the call to `estimate_scr_by ()`"
50+ " `build_graph` was not `TRUE` in the call to `est_seroincidence_by ()`"
5151 )
5252 figure <- NULL
5353 }
5454
5555 labels <- names(object )
5656 figs <- lapply(object , FUN = autoplot.seroincidence , ... )
5757
58- for (i in 1 : length(figs ))
59- {
58+ for (i in seq_along(figs )){
6059 figs [[i ]] <- figs [[i ]] + ggplot2 :: ggtitle(labels [i ])
6160 }
6261
0 commit comments