Skip to content

Commit dce9f69

Browse files
committed
Output formatting tweaks
1 parent 3961d44 commit dce9f69

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

synoptic/L1.qmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ f <- function(dir_name, dirs_to_process, out_dir) {
102102
if(nrow(flg)) {
103103
flg$Flag_type <- "OOB"
104104
flg$Remark <- basename(dir_name)
105-
message("\tSending ", nrow(flg), " flags to database")
105+
message("Sending ", nrow(flg), " flags to database")
106106
fdb_add_flags(site, flg)
107107
}
108108

synoptic/flag-database.R

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,18 @@ fdb_open <- function(root, init = FALSE) {
2121
fdb_add_flags <- function(site, flag_data, fdb = FDB) {
2222
if(site %in% dbListTables(fdb)) {
2323
# We don't want to create identical rows
24-
# The SQLite way to do this would be using UPDATE or REPLACE, but
25-
# given our small data volumes, it seems simpler to use R's duplicated()
24+
# Given our small data volumes, seems simplest to use R's duplicated()
2625
old_data <- dbReadTable(fdb, site)
2726
new_data <- rbind(old_data, flag_data)
2827
new_data <- new_data[!duplicated(new_data),]
2928
dbWriteTable(fdb, site, new_data, overwrite = TRUE)
3029
rows <- nrow(new_data) - nrow(old_data)
3130
} else {
32-
message("Creating new site ", site)
31+
message("\tCreating new site ", site)
3332
dbWriteTable(fdb, site, flag_data)
3433
rows <- nrow(flag_data)
3534
}
36-
message("Added ", rows, " rows")
35+
message("\tAdded ", rows, " rows")
3736
}
3837

3938
# Get flag data for a single site

synoptic/helpers.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ write_to_folders <- function(x, root_dir, data_level, site,
145145
basename(folder), "/", filename)
146146

147147
fn <- file.path(folder, filename)
148-
if(file.exists(fn)) message("NOTE: overwriting existing file")
148+
if(file.exists(fn)) message("\tNOTE: overwriting existing file")
149149
# We were using readr::write_csv for this but it was
150150
# randomly crashing on GA (Error in `vroom write()`: ! bad value)
151151
write.csv(dat, fn, row.names = FALSE, na = na_string)

0 commit comments

Comments
 (0)