Skip to content

Commit

Permalink
more descriptive frollmean window size name
Browse files Browse the repository at this point in the history
  • Loading branch information
nmdefries committed Mar 26, 2024
1 parent 0def9c8 commit 237fc38
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/slide.R
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ epi_slide_mean <- function(x, col_names, ..., before, after, ref_time_values,

# `frollmean` is 1-indexed, so create a new window width based on our
# `before` and `after` params.
m <- before + after + 1L
window_size <- before + after + 1L

col_names_quo <- enquo(col_names)
col_names_chr <- as.character(rlang::quo_get_expr(col_names_quo))
Expand Down Expand Up @@ -693,7 +693,7 @@ epi_slide_mean <- function(x, col_names, ..., before, after, ref_time_values,
}

roll_output <- data.table::frollmean(
x = select(.data_group, {{ col_names }}), n = m, align = "right", ...
x = select(.data_group, {{ col_names }}), n = window_size, align = "right", ...
)

if (after >= 1) {
Expand Down

0 comments on commit 237fc38

Please sign in to comment.