Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix option c #135 #194

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 <- 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
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
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
Loading