Skip to content

Commit

Permalink
more linting
Browse files Browse the repository at this point in the history
  • Loading branch information
nmdefries committed Mar 14, 2024
1 parent 18d1ec3 commit d4eb0e7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions R/slide.R
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ epi_slide_mean <- function(x, col_names, ..., before, after, ref_time_values,
.data_group,
tibble(time_value = c(missing_times, pad_early_dates, pad_late_dates), .real = FALSE)
) %>%
arrange(time_value)
arrange(.data$time_value)

# If a group contains duplicate time values, `frollmean` will still only
# use the last `k` obs. It isn't looking at dates, it just goes in row
Expand Down Expand Up @@ -721,7 +721,7 @@ full_date_seq <- function(x, before, after, time_step) {
# `tsibble` classes apparently can't be added to in different units, so even
# if `time_step` is provided by the user, use a unit step.
if (inherits(x$time_value, c("yearquarter", "yearweek", "yearmonth")) ||
is.numeric(x$time_value)) {
is.numeric(x$time_value)) {
all_dates <- seq(min(x$time_value), max(x$time_value), by = 1L)

if (before != 0) {
Expand Down
12 changes: 6 additions & 6 deletions tests/testthat/test-epi_slide.R
Original file line number Diff line number Diff line change
Expand Up @@ -1037,17 +1037,17 @@ test_that("results for different time_types match between epi_slide and epi_slid
epiprocess::as_epi_df(rbind(tibble(
geo_value = "al",
time_value = date_seq,
a = 1:length(date_seq),
a = seq_along(date_seq),
b = rand_vals
), tibble(
geo_value = "ca",
time_value = date_seq,
a = length(date_seq):1,
a = rev(seq_along(date_seq)),
b = rand_vals + 10
), tibble(
geo_value = "fl",
time_value = date_seq,
a = length(date_seq):1,
a = rev(seq_along(date_seq)),
b = rand_vals * 2
)), ...)
}
Expand Down Expand Up @@ -1175,17 +1175,17 @@ test_that("helper `full_date_seq` returns expected date values", {
epiprocess::as_epi_df(rbind(tibble(
geo_value = "al",
time_value = date_seq,
a = 1:length(date_seq),
a = seq_along(date_seq),
b = rand_vals
), tibble(
geo_value = "ca",
time_value = date_seq,
a = length(date_seq):1,
a = rev(seq_along(date_seq)),
b = rand_vals + 10
), tibble(
geo_value = "fl",
time_value = date_seq,
a = length(date_seq):1,
a = rev(seq_along(date_seq)),
b = rand_vals * 2
)), ...)
}
Expand Down

0 comments on commit d4eb0e7

Please sign in to comment.