Skip to content

Commit

Permalink
createStaticNASIS: fix error when output_path=NULL (list output)
Browse files Browse the repository at this point in the history
 - related to 921b75e
  • Loading branch information
brownag committed Dec 16, 2024
1 parent 0aec714 commit 97541da
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions R/createStaticNASIS.R
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
# Method for "dumping" contents of an entire NASIS table
#
# Method for "dumping" contents of an entire NASIS table
#
#
# @param table_name Character name of table.
# @param dsn Optional: path to SQLite database containing NASIS table
# structure; Default: \code{NULL}
# @return A data.frame or other result of \code{DBI::dbGetQuery}
# @export .dump_NASIS_table
# .dump_NASIS_table <- function(table_name, dsn = NULL) {
#
# # connect to NASIS, identify columns
Expand Down Expand Up @@ -127,8 +123,7 @@ createStaticNASIS <- function(tables = NULL,
if (is.null(output_path)) {

# return named list of data.frames or try-error (one per table)
res <- lapply(nasis_table_names, function(n) try(.dump_NASIS_table(n, dsn = dsn),
silent = verbose))
res <- lapply(nasis_table_names, function(n) try(DBI::dbReadTable(con, n), silent = verbose))
if(!is.null(new_names))
names(res) <- new_names
else names(res) <- nasis_table_names
Expand Down

0 comments on commit 97541da

Please sign in to comment.