From ad88107374549dccc15b4bbe0c0fe642b7853b98 Mon Sep 17 00:00:00 2001 From: John Edwards Date: Tue, 12 Sep 2023 21:09:46 -0700 Subject: [PATCH] Update update-players.R --- src/update-players.R | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/update-players.R b/src/update-players.R index f34787c..b7f4d2e 100644 --- a/src/update-players.R +++ b/src/update-players.R @@ -33,8 +33,14 @@ build_players <- function() { weight == '' ~ NA_integer_, weight == 0 ~ NA_integer_, T ~ as.integer(weight) - ) + ), + # fixing inconsistent birthday formatting + birth_date_1 = lubridate::ymd(birth_date), + birth_date_2 = lubridate::mdy(birth_date), + birth_date = dplyr::coalesce(birth_date_1, birth_date_2), + birth_date = as.character(birth_date) ) |> + dplyr::select(-c(birth_date_1,birth_date_2)) |> tidyr::separate( height, fill = "left",