Skip to content

Commit

Permalink
fix user uploaded data pathway
Browse files Browse the repository at this point in the history
run autoclean, include placeholder for user message regarding required cols
  • Loading branch information
cristinamullin committed Dec 16, 2024
1 parent f2bbaa4 commit c45e8f9
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions R/mod_query_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit c45e8f9

Please sign in to comment.