From 10add40759ec2b28224dd3981643715783df3284 Mon Sep 17 00:00:00 2001 From: rqthomas Date: Thu, 2 Nov 2023 15:46:56 -0400 Subject: [PATCH] catching reference_datetime --- submission_processing/process_submissions.R | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/submission_processing/process_submissions.R b/submission_processing/process_submissions.R index cedf5ee024..648ac6dd92 100644 --- a/submission_processing/process_submissions.R +++ b/submission_processing/process_submissions.R @@ -71,6 +71,7 @@ if(length(submissions) > 0){ curr_submission <- basename(submissions[i]) theme <- stringr::str_split(curr_submission, "-")[[1]][1] model_id <- stringr::str_split(tools::file_path_sans_ext(tools::file_path_sans_ext(curr_submission)), "-")[[1]][5] + reference_datetime <- lubridate::as_datetime(paste0(stringr::str_split(curr_submission, "-")[[1]][2:4], collapse = "-")) submission_dir <- dirname(submissions[i]) print(curr_submission) @@ -104,6 +105,10 @@ if(length(submissions) > 0){ fc <- fc |> mutate(model_id = model_id) } + if(!("reference_datetime" %in% colnames(fc))){ + fc <- fc |> mutate(reference_datetime = reference_datetime) + } + fc <- fc |> dplyr::mutate(pub_datetime = lubridate::as_datetime(pub_datetime), datetime = lubridate::as_datetime(datetime),