Skip to content

Commit 999273d

Browse files
committed
for quidel signals, use existing start/end times
1 parent 9b5c16b commit 999273d

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

scripts/signal_spreadsheet_updater.R

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,13 +180,21 @@ source3 <- left_join(
180180
by = c("Signal" = "signal", "data_source")
181181
)
182182

183-
# select: source subdivision, signal, scope start, scope end, min_time, max_time
183+
# Fill in Temporal Scope Start/End for quidel signals by coalescing the existing
184+
# column with the new data; quidel dates have already been filled in manually in
185+
# the spreadsheet.
186+
source3$min_time <- case_when(
187+
source3$data_source == "quidel" ~ coalesce(source3$min_time, source3$`Temporal Scope Start`)
188+
)
189+
source3$max_time <- case_when(
190+
source3$data_source == "quidel" ~ coalesce(source3$max_time, source3$`Temporal Scope Start`)
191+
)
192+
193+
# Select relevant columns
184194
# first reformat max_time col to character for compatibility
185195
# also convert min_time col to character (easier to move times over to google spreadsheet without corrupting)
186196
# *only in dplyr can you use col names without quotations, as.character is base function
187197
# *min_time, we can just use the earliest date available and not specify each geo's different dates
188-
189-
# TODO: fill in Temporal Scope Start/End for quidel signals by coalescing the existing column with the new data; quidel dates have already been filled in manually in the spreadsheet.
190198
source4 <- mutate(
191199
source3,
192200
`Temporal Scope Start Note` = min_time_notes,

0 commit comments

Comments
 (0)