Skip to content

Commit

Permalink
Update mod_query_data.R
Browse files Browse the repository at this point in the history
run autoclean and check required fields when data is uploaded in Option C on import tab
  • Loading branch information
cristinamullin committed Dec 5, 2024
1 parent 6804bbe commit 350e769
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions R/mod_query_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,19 @@ mod_query_data_server <- function(id, tadat) {
)

# user uploaded data
raw <-
suppressWarnings(readxl::read_excel(input$file$datapath, sheet = 1))
raw <- suppressWarnings(readxl::read_excel(input$file$datapath, sheet = 1))

# 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, commented out for now.
# raw <- EPATADA::TADA_CheckRequiredFields(raw)
# run autoclean
raw <- EPATADA::TADA_AutoClean(raw)

# other steps to prepare data for app
raw$TADA.Remove <- NULL
initializeTable(tadat, raw)
if (!is.null(tadat$original_source)) {
Expand Down

0 comments on commit 350e769

Please sign in to comment.