-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathprint.seroincidence.by.R
More file actions
58 lines (57 loc) · 1.68 KB
/
Copy pathprint.seroincidence.by.R
File metadata and controls
58 lines (57 loc) · 1.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#' @title
#' Print Method for `seroincidence.by` Object
#'
#' @description
#' Custom [print()] function for `seroincidence.by` objects
#' (from [est_seroincidence_by()])
#'
#' @param x A list containing output of function [est_seroincidence_by()].
#' @param ... Additional arguments affecting the summary produced.
#' @inherit print.seroincidence return
#' @examples
#' library(dplyr)
#'
#' xs_data <-
#' sees_pop_data_pk_100
#'
#' curve <-
#' typhoid_curves_nostrat_100 |>
#' filter(antigen_iso %in% c("HlyE_IgA", "HlyE_IgG"))
#'
#' noise <-
#' example_noise_params_pk
#'
#' # estimate seroincidence
#' est2 <- est_seroincidence_by(
#' strata = c("catchment"),
#' pop_data = xs_data,
#' sr_params = curve,
#' noise_params = noise,
#' antigen_isos = c("HlyE_IgG", "HlyE_IgA"),
#' # num_cores = 8 # Allow for parallel processing to decrease run time
#' )
#'
#' # calculate summary statistics for the seroincidence object
#' print(est2)
#'
#' @export
#' @keywords internal
print.seroincidence.by <- function(x, ...) {
cat("`seroincidence.by` object estimated given the following setup:\n")
cat("a) Antigen isotypes :",
paste(attr(x, "antigen_isos"), collapse = ", "),
"\n")
cat("b) Strata :",
paste(attr(x, "Strata") |> attr("strata_vars"), collapse = ", "),
"\n")
cat("\n")
cat("This object is a list of `seroincidence` objects,",
"with added meta-data attributes:\n")
cat("`antigen_isos` -",
"Character vector of antigen isotypes used in analysis.\n")
cat("`Strata` -",
"Input parameter strata of function `est_seroincidence_by()`\n")
cat("\n")
cat("Call the `summary()` function to obtain output results.\n")
invisible(x)
}