Skip to content

Commit

Permalink
group before filter
Browse files Browse the repository at this point in the history
  • Loading branch information
joethorley committed Apr 22, 2024
1 parent 3037770 commit 2944750
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/internal.R
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@
year = stringr::str_extract(.data$year, "^\\d{4,4}"),
year = as.integer(.data$year),
dayte = dttr2::dtt_dayte(.data$date, start = start_date)) |>
dplyr::filter(.data$dayte >= start_dayte, .data$dayte <= end_dayte) |>
dplyr::group_by(.data$year) |>
dplyr::filter(.data$dayte >= start_dayte, .data$dayte <= end_dayte) |>
dplyr::arrange(.data$dayte)

x <- x |>
Expand Down Expand Up @@ -209,8 +209,8 @@
year = stringr::str_extract(.data$year, "^\\d{4,4}"),
year = as.integer(.data$year),
dayte = dttr2::dtt_dayte(.data$date, start = start_date)) |>
dplyr::filter(.data$dayte >= start_dayte, .data$dayte <= end_dayte) |>
dplyr::group_by(.data$year) |>
dplyr::filter(.data$dayte >= start_dayte, .data$dayte <= end_dayte) |>
dplyr::arrange(.data$dayte)

if(is.null(min_length)) {
Expand Down

0 comments on commit 2944750

Please sign in to comment.