From 19dd3d868c321bfc636c965f3f21f3ff8298ec3c Mon Sep 17 00:00:00 2001 From: Joshua Lambert Date: Fri, 20 Sep 2024 16:35:28 +0100 Subject: [PATCH] update outdated create_summary_stats function return documentation --- R/epiparameter-utils.R | 12 +++++++----- man/create_summary_stats.Rd | 24 ++++++++++++++++++------ 2 files changed, 25 insertions(+), 11 deletions(-) diff --git a/R/epiparameter-utils.R b/R/epiparameter-utils.R index c7c0ec750..eb95b5a5a 100644 --- a/R/epiparameter-utils.R +++ b/R/epiparameter-utils.R @@ -214,6 +214,7 @@ create_region <- function(continent = NA_character_, ) } +# nolint start: line_length_linter #' Specify reported summary statistics #' #' @description A helper function when creating an `` object to @@ -259,11 +260,11 @@ create_region <- function(continent = NA_character_, #' If quantiles are not provided a default empty vector with the 2.5th, 5th, #' 25th, 75th, 95th, 97.5th quantiles are supplied. #' -#' @return A nested list of summary statistics. The highest level are -#' - `$centre_spread` -#' - `$quantiles` -#' - `$range` -#' - `$dispersion` +#' @return A list of summary statistics. The output list has element names +#' equal to the function arguments: +#' \preformatted{ +#' `r paste("$", names(formals(create_summary_stats)), sep = "", collapse = "\n")` +#' } #' @export #' #' @examples @@ -286,6 +287,7 @@ create_region <- function(continent = NA_character_, #' lower_range = 1, #' upper_range = 13 #' ) +# nolint end: line_length_linter create_summary_stats <- function(mean = NA_real_, mean_ci_limits = c(NA_real_, NA_real_), mean_ci = NA_real_, diff --git a/man/create_summary_stats.Rd b/man/create_summary_stats.Rd index 00ccd39fe..787d27c71 100644 --- a/man/create_summary_stats.Rd +++ b/man/create_summary_stats.Rd @@ -76,12 +76,24 @@ If quantiles are not provided a default empty vector with the 2.5th, 5th, 25th, 75th, 95th, 97.5th quantiles are supplied.} } \value{ -A nested list of summary statistics. The highest level are -\itemize{ -\item \verb{$centre_spread} -\item \verb{$quantiles} -\item \verb{$range} -\item \verb{$dispersion} +A list of summary statistics. The output list has element names +equal to the function arguments: +\preformatted{ +$mean +$mean_ci_limits +$mean_ci +$sd +$sd_ci_limits +$sd_ci +$median +$median_ci_limits +$median_ci +$dispersion +$dispersion_ci_limits +$dispersion_ci +$lower_range +$upper_range +$quantiles } } \description{