Skip to content

Commit

Permalink
Fix removing duplicate field names
Browse files Browse the repository at this point in the history
  • Loading branch information
wkmor1 committed Dec 20, 2023
1 parent eecd7f5 commit 0a6ef1d
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions R/finbif_occurrence_load.R
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,14 @@ finbif_occurrence_load <- function(

}

} else {

select_user_keep <- !duplicated(select[["user"]])

select[["user"]] <- select[["user"]][select_user_keep]

fb_occurrence_df <- fb_occurrence_df[, select_user_keep, drop = FALSE]

}

attr(fb_occurrence_df, "file_cols") <- NULL
Expand Down Expand Up @@ -379,7 +387,6 @@ finbif_occurrence_load <- function(

}


select_user <- name_chr_vec(select[["user"]])

fb_occurrence_df <- fb_occurrence_df[, select_user, drop = FALSE]
Expand Down Expand Up @@ -913,8 +920,6 @@ dt_read <- function(fb_occurrence_obj) {

cols <- rownames(cols)

cols <- unique(cols)

if (file.exists(args[["input"]])) {

cols <- do.call(data.table::fread, args)
Expand Down Expand Up @@ -1554,8 +1559,6 @@ open_tsv_connection <- function(connection_obj) {

vars <- rownames(vars)

vars <- unique(vars)

vars <- paste0(vars, collapse = "\t")

textConnection(vars)
Expand Down

0 comments on commit 0a6ef1d

Please sign in to comment.