Skip to content

Commit

Permalink
remove dplyr first on area level
Browse files Browse the repository at this point in the history
  • Loading branch information
M-Kusumgar committed Sep 4, 2024
1 parent 3f47198 commit cba1c5e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions R/input-time-series.R
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ aggregate_art <- function(art, shape, drop_geometry = TRUE) {
# > area_level is one less since we are aggregating to the parent
# > sum across all the other numeric values ignoring NAs
dplyr::summarise(
area_level = dplyr::first(area_level) - 1,
area_level = level - 1,
dplyr::across(dplyr::any_of(cols_list), ~sum(.x, na.rm = TRUE)),
.groups = "drop"
) |>
Expand Down Expand Up @@ -280,7 +280,7 @@ prepare_input_time_series_art <- function(art, shape) {
# up to the parent
dplyr::summarise(
missing_ids = list(unlist(missing_ids, FALSE, FALSE)),
area_level = dplyr::first(area_level) - 1,
area_level = level - 1,
.groups = "drop"
) |>
dplyr::rename(area_id = parent_area_id) |>
Expand Down Expand Up @@ -380,7 +380,7 @@ aggregate_anc <- function(anc, shape, drop_geometry = TRUE) {
# > area_level is one less since we are aggregating to the parent
# > sum across all the other numeric values ignoring NAs
dplyr::summarise(
area_level = dplyr::first(area_level) - 1,
area_level = level - 1,
dplyr::across(dplyr::any_of(cols_list), ~sum(.x, na.rm = TRUE)),
.groups = "drop"
) |>
Expand Down Expand Up @@ -478,7 +478,7 @@ prepare_input_time_series_anc <- function(anc, shape) {
# up to the parent
dplyr::summarise(
missing_ids = list(unlist(missing_ids, FALSE, FALSE)),
area_level = dplyr::first(area_level) - 1,
area_level = level - 1,
.groups = "drop"
) |>
dplyr::rename(area_id = parent_area_id) |>
Expand Down

0 comments on commit cba1c5e

Please sign in to comment.