@@ -33,6 +33,7 @@ suppressPackageStartupMessages({
33
33
# Suppresses read_csv progress and column type messages
34
34
options(readr.show_progress = FALSE )
35
35
options(readr.show_col_types = FALSE )
36
+ options(cli.width = 120 )
36
37
37
38
# Script run time
38
39
run_time <- with_tz(Sys.time(), tzone = " UTC" )
@@ -154,7 +155,7 @@ process_nhsn_data_file <- function(key) {
154
155
# ' day. The archive has the columns geo_value, time_value, disease, endpoint
155
156
# ' (either basic or prelim), version, version_timestamp (to enable keeping the
156
157
# ' most recent value), and value.
157
- update_nhsn_data_archive <- function (verbose = FALSE ) {
158
+ update_nhsn_data_archive <- function () {
158
159
# Get the last timestamp of the archive
159
160
last_timestamp <- get_s3_object_last_modified(config $ archive_s3_key , config $ s3_bucket )
160
161
@@ -181,12 +182,11 @@ update_nhsn_data_archive <- function(verbose = FALSE) {
181
182
return (invisible (NULL ))
182
183
}
183
184
184
- cli_inform(" New datasets available at {run_time_local} (UTC: {run_time})." )
185
- cli_inform(" Adding {nrow(new_data_files_latest_per_day)} new NHSN datasets to the archive." )
185
+ cli_inform(" New datasets available at, adding {nrow(new_data_files_latest_per_day)} new NHSN datasets to the archive." )
186
186
187
187
# Process each new dataset snapshot
188
188
new_data <- new_data_files_latest_per_day $ Key %> %
189
- map(process_nhsn_data_file , .progress = verbose ) %> %
189
+ map(process_nhsn_data_file , .progress = interactive() ) %> %
190
190
bind_rows()
191
191
192
192
# Look through the existing archive to see if there were updates today. If so, replace them with the new data.
@@ -204,12 +204,11 @@ update_nhsn_data_archive <- function(verbose = FALSE) {
204
204
}
205
205
206
206
update_nhsn_data <- function (verbose = FALSE ) {
207
- options(cli.width = 120 )
208
207
if (verbose ) {
209
208
cli_inform(glue(" Checking for updates to NHSN data at {run_time_local} (UTC: {run_time})..." ))
210
209
}
211
210
update_nhsn_data_raw()
212
- update_nhsn_data_archive(verbose = verbose )
211
+ update_nhsn_data_archive()
213
212
}
214
213
215
- update_nhsn_data(verbose = TRUE )
214
+ update_nhsn_data(verbose = TRUE )
0 commit comments