From 27e71536781afbe0db3758fc6d9dafd7f8cd2744 Mon Sep 17 00:00:00 2001 From: gavieira Date: Sat, 11 Nov 2023 12:35:01 -0300 Subject: [PATCH] fixed shinyapp's merge_input_files() behaviour of adding NA to entire columns --- inst/biblioverApp/server.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inst/biblioverApp/server.R b/inst/biblioverApp/server.R index 1028598..17b7f97 100644 --- a/inst/biblioverApp/server.R +++ b/inst/biblioverApp/server.R @@ -253,7 +253,7 @@ server <- function(input, output, session) { ) df[] <- lapply(df, function(col) { #Cleaning data (one column at a time) col <- trimws(as.character(col)) # Removing leading and trailing whitespaces - if (any(col == "" | is.na(col))) col <- NA # Convert empty or null values to NA + col[which(col == "" | is.null(col))] <- NA # Convert empty or null values to NA return(col) }) df <- df[!duplicated(df), ] # Removing duplicate records