From eecd7f5fe4368cf74d223e2d1545f1dbb9085a63 Mon Sep 17 00:00:00 2001 From: wkmor1 Date: Wed, 20 Dec 2023 15:02:48 +0200 Subject: [PATCH] Ensure 0-row dfs have unique column names --- R/finbif_occurrence_load.R | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/R/finbif_occurrence_load.R b/R/finbif_occurrence_load.R index 1fe9cc6a..af9ac475 100644 --- a/R/finbif_occurrence_load.R +++ b/R/finbif_occurrence_load.R @@ -909,7 +909,11 @@ dt_read <- function(fb_occurrence_obj) { } - cols <- rownames(sysdata("cite_file_vars")) + cols <- sysdata("cite_file_vars") + + cols <- rownames(cols) + + cols <- unique(cols) if (file.exists(args[["input"]])) { @@ -1550,6 +1554,8 @@ open_tsv_connection <- function(connection_obj) { vars <- rownames(vars) + vars <- unique(vars) + vars <- paste0(vars, collapse = "\t") textConnection(vars)