Skip to content
This repository has been archived by the owner on Nov 16, 2024. It is now read-only.

Commit

Permalink
Apply suggestions from code review by @athowes
Browse files Browse the repository at this point in the history
Co-authored-by: Adam Howes <adamthowes@gmail.com>
  • Loading branch information
gvegayon and athowes authored Sep 25, 2024
1 parent fb032b1 commit e808b55
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions R/summarize_rtestimate.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@
#' @param date Integer vector. vector of index dates.
#' @param median Double vector. vector of median values.
#' @param lb Double vector. vector of lower bounds.
#' @param up Double vector. vector of upper bounds.
#' @param ub Double vector. vector of upper bounds.
#' @param package String. Name of the package.
#' @export
#' @return A list of class `summrt_summary`. with the following components:
#' - `date`: Integer vector. vector of index dates.
#' - `median`: Double vector. vector of median values.
#' - `lb`: Double vector. vector of lower bounds.
#' - `up`: Double vector. vector of upper bounds.
#' - `ub`: Double vector. vector of upper bounds.
#' - `package`: String. Name of the package.
new_summarize <- function(
date, median, lb, up, package
date, median, lb, ub, package
) {

# Asserting the types
Expand All @@ -32,15 +32,15 @@ new_summarize <- function(
len_lb <- length(lb)
len_up <- length(up)
if (len_date != len_median || len_date != len_lb || len_date != len_up) {
stop("The length of the date, median, lb, and up should be the same.")
stop("The length of the date, median, lb, and ub should be the same.")
}

structure(
list(
date = date,
median = median,
lb = lb,
up = up,
ub = ub,
package = package
),
class = "summrt_summary"
Expand Down Expand Up @@ -133,7 +133,7 @@ summarize_rtestimate.estimate_R <- function(x, ...) {
date = x$R$t_end,
median = x$R$`Median(R)`,
lb = x$R$`Quantile.0.025(R)`,
up = x$R$`Quantile.0.975(R)`,
ub = x$R$`Quantile.0.975(R)`,
package = "EpiEstim"
)
}

0 comments on commit e808b55

Please sign in to comment.