Skip to content

Commit

Permalink
simplify write.table
Browse files Browse the repository at this point in the history
As in #192, suggested by @kellijohnson-NOAA
  • Loading branch information
k-doering-NOAA committed Apr 1, 2024
1 parent 95afd89 commit 25ae00e
Showing 1 changed file with 9 additions and 23 deletions.
32 changes: 9 additions & 23 deletions R/extendOM.R
Original file line number Diff line number Diff line change
Expand Up @@ -495,30 +495,16 @@ update_OM <- function(OM_dir,
verbose = FALSE
)


if (file.exists(file.path(OM_dir, "OM_catch_search_log.csv"))) {
utils::write.table(
x = search_log,
file = file.path(OM_dir, "OM_catch_search_log.csv"),
append = TRUE,
row.names = FALSE,
col.names = FALSE,
sep = ",",
dec = ".",
qmethod = "double"
utils::write.table(
x = search_log,
file = file.path(OM_dir, "OM_catch_search_log.csv"),
append = file.exists(file.path(OM_dir, "OM_catch_search_log.csv")),
row.names = FALSE,
col.names = !file.exists(file.path(OM_dir, "OM_catch_search_log.csv")),
sep = ",",
dec = ".",
qmethod = "double"
)
} else {
suppressWarnings(utils::write.table(
x = search_log,
file = file.path(OM_dir, "OM_catch_search_log.csv"),
append = TRUE,
row.names = FALSE,
col.names = TRUE,
sep = ",",
dec = ".",
qmethod = "double"
))
}
}
}

Expand Down

0 comments on commit 25ae00e

Please sign in to comment.