Skip to content

Commit

Permalink
Merge pull request #195 from USEPA/fix-option-C-#135
Browse files Browse the repository at this point in the history
Fix option c #135
  • Loading branch information
cristinamullin authored Dec 23, 2024
2 parents 7657570 + 84eb737 commit 6d01311
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
15 changes: 13 additions & 2 deletions R/mod_query_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -305,8 +305,19 @@ 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 autoclean
raw <- EPATADA::TADA_AutoClean(raw)

#####
# check that all TADA template columns are included (returns TRUE or FALSE)
# if FALSE, returns an error with names of specific columns that are missing but required
# this section needs to be updated to handle the error within the shiny app (instead of crashing) & display a message to users
EPATADA::TADA_CheckRequiredFields(raw)
#####

# other steps to prepare data for app
raw$TADA.Remove <- NULL
initializeTable(tadat, raw)
if (!is.null(tadat$original_source)) {
Expand Down
5 changes: 2 additions & 3 deletions R/utils_flag_functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ applyFlags <- function(in_table, orgs) {
out <- EPATADA::TADA_FlagResultUnit(out, clean = "none")

# QC rep/blank
out <- EPATADA::TADA_FindQCActivities(out, clean = FALSE)
out <- EPATADA::TADA_FindQCActivities(out, clean = FALSE, flaggedonly = FALSE)

# Result is flagged as suspect by data submitter
out <- EPATADA::TADA_FlagMeasureQualifierCode(out, clean = FALSE, define = TRUE)
Expand All @@ -116,8 +116,7 @@ applyFlags <- function(in_table, orgs) {

# Continuous data
out <- EPATADA::TADA_FlagContinuousData(out, clean = FALSE,
flaggedonly = FALSE,
time_difference = 4)
flaggedonly = FALSE)

# Above WQX Upper Threshold
out <- EPATADA::TADA_FlagAboveThreshold(out, clean = FALSE)
Expand Down

0 comments on commit 6d01311

Please sign in to comment.