From c45e8f9c62d63390d713800cca58f4b0ddad03a4 Mon Sep 17 00:00:00 2001 From: cristinamullin <46969696+cristinamullin@users.noreply.github.com> Date: Mon, 16 Dec 2024 18:47:28 -0500 Subject: [PATCH] fix user uploaded data pathway run autoclean, include placeholder for user message regarding required cols --- R/mod_query_data.R | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/R/mod_query_data.R b/R/mod_query_data.R index f3a59dd6..4096b4a7 100644 --- a/R/mod_query_data.R +++ b/R/mod_query_data.R @@ -305,18 +305,18 @@ mod_query_data_server <- function(id, tadat) { ) # user uploaded data - raw <- suppressWarnings(readxl::read_excel(input$file$datapath, sheet = 1)) + raw <- readxl::read_excel(input$file$datapath, sheet = 1, col_types = "text") - # run code included in TADA data retrieval - # need to specify this or throws error when trying to bind rows. Temporary fix for larger - # issue where data structure for all columns should be specified. - cols <- names(raw) - raw <- raw %>% dplyr::mutate_at(cols, as.character) - # check that all TADA template columns are included - raw <- EPATADA::TADA_CheckRequiredFields(raw) # run autoclean raw <- EPATADA::TADA_AutoClean(raw) + ##### + # check that all TADA template columns are included (returns TRUE or FALSE) + # need to add user message here if FALSE, message should include the + # names of specific columns that are missing but required + EPATADA::TADA_CheckRequiredFields(raw) + ##### + # other steps to prepare data for app raw$TADA.Remove <- NULL initializeTable(tadat, raw)