Skip to content

Commit

Permalink
Update validate_data to take any data and not only AFRO data
Browse files Browse the repository at this point in the history
  • Loading branch information
truenomad committed Oct 25, 2024
1 parent 994cb05 commit 9c73c43
Show file tree
Hide file tree
Showing 8 changed files with 95 additions and 764 deletions.
4 changes: 1 addition & 3 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ export(check_data)
export(check_land_water)
export(check_leap_issue)
export(check_missing)
export(compare_polis_snapshots)
export(compress_png_files)
export(correct_flipped_geo_coords)
export(create_gt_table)
Expand All @@ -33,9 +32,8 @@ export(prep_new_detections_table)
export(prep_ona_data_endpoints)
export(read)
export(save)
export(summarize_validation_results)
export(validate_admin_hierarchy)
export(validate_afro)
export(validate_data)
export(validate_date)
export(validate_dates)
export(validate_polis)
Expand Down
22 changes: 11 additions & 11 deletions R/assign_round_number.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@
#' ordered as factors.
#'
#' @examples
#' df <- data.frame(
#' today = as.Date(
#' c("2024-04-28", "2024-05-03", "2024-05-04", "2024-05-03",
#' "2024-06-01", "2024-06-02", "2024-07-29", "2024-07-30")),
#' states = c("State1", "State1", "State1", "State1", "State2", "State2",
#' "State2", "State2")
#' )
#' result <- assign_round_number(df, date_col = "today",
#' additional_grouping = "states")
#' print(result)
#' # df <- data.frame(
#' # today = as.Date(
#' # c("2024-04-28", "2024-05-03", "2024-05-04", "2024-05-03",
#' # "2024-06-01", "2024-06-02", "2024-07-29", "2024-07-30")),
#' # states = c("State1", "State1", "State1", "State1", "State2", "State2",
#' # "State2", "State2")
#' # )
#' # result <- assign_round_number(df, date_col = "today",
#' # additional_grouping = "states")
#' # print(result)
#'
#' @export
# Define the function to assign round numbers based on proximity
Expand Down Expand Up @@ -88,7 +88,7 @@ assign_round_number <- function(df,
round_group = factor(round_group,
levels = round_labels,
ordered = TRUE
)
) |> dplyr::select(-ClusterID)
)

return(df)
Expand Down
Loading

0 comments on commit 9c73c43

Please sign in to comment.