Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
b7ba0e3
Update WQXcharValRef to rda file
cristinamullin Feb 1, 2024
1b99c49
update vignette refs
cristinamullin Feb 2, 2024
0f59773
Merge branch 'develop' into file_storage
cristinamullin May 10, 2024
3b10cde
Merge branch 'develop' into file_storage
cristinamullin Sep 12, 2024
3a0c767
WQXCharValRef as rda
cristinamullin Sep 12, 2024
14d3b04
Update Maintenance.R
cristinamullin Sep 12, 2024
ac25fdc
Update Maintenance.R
cristinamullin Sep 12, 2024
a35b817
add rda files
cristinamullin Sep 16, 2024
41a8481
Merge branch 'develop' into file_storage
cristinamullin Nov 12, 2024
73dd0f1
Update WQXcharValRef.rda
cristinamullin Nov 12, 2024
ee72e5f
run styler and update example data
cristinamullin Nov 12, 2024
fab91a1
update ref
cristinamullin Nov 13, 2024
68026e1
add dev ref
cristinamullin Nov 13, 2024
c68b10d
Merge branch 'develop' into file_storage
cristinamullin Nov 14, 2024
a8733c7
Merge branch 'file_storage' into range-flag-update
cristinamullin Nov 14, 2024
abd1d24
incorporate recent updates to tests involving validation table
cristinamullin Nov 14, 2024
39e553c
Merge branch 'QCtable_test' into range-flag-update
cristinamullin Nov 14, 2024
a473f06
update data
cristinamullin Nov 14, 2024
3d29db7
Merge branch 'develop' into range-flag-update
cristinamullin Oct 14, 2025
3aa7a7a
Delete WQXcharValRef.csv
cristinamullin Oct 14, 2025
41bba71
update refs and example data
cristinamullin Oct 14, 2025
75d6e21
switch to WQXcharValRef.rda
cristinamullin Oct 15, 2025
94d171a
Merge branch 'develop' into range-flag-update
cristinamullin Oct 15, 2025
98438f4
Merge branch 'develop' into range-flag-update
cristinamullin Oct 17, 2025
34fb53b
Merge branch 'develop' into range-flag-update
cristinamullin Oct 17, 2025
ecb4277
update range flag function logic
cristinamullin Oct 17, 2025
38065b1
document
cristinamullin Oct 17, 2025
0fd4c9a
add dplyr::
cristinamullin Oct 17, 2025
58aa7d7
add libraries
cristinamullin Oct 17, 2025
4d52e07
Merge branch 'develop' into range-flag-update
cristinamullin Oct 17, 2025
1a783a9
styler
cristinamullin Oct 20, 2025
7d075d3
TADA_RandomTestingData error handling
cristinamullin Oct 20, 2025
14ab22c
handling empty dfs
cristinamullin Oct 20, 2025
3800545
styler
cristinamullin Oct 20, 2025
f78ca5c
duplicate links
cristinamullin Oct 20, 2025
76eaaa3
Merge branch 'develop' into range-flag-update
cristinamullin Oct 20, 2025
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
5 changes: 0 additions & 5 deletions R/ATTAINSCrosswalks.R
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ TADA_GetATTAINSAUMLCrosswalk <- function(org_id = NULL,
}



#' Update Monitoring Location Identifier and Assessment Unit Identifier
#' Crosswalk in ATTAINS
#'
Expand Down Expand Up @@ -1456,7 +1455,6 @@ TADA_CreateParamRef <- function(.data, org_id = NULL, paramRef = NULL, auto_assi
}



#' Create or Update ATTAINS Parameter and Use crosswalk
#'
#' This function generates a crosswalk of all parameters and uses applicable to
Expand Down Expand Up @@ -2161,7 +2159,6 @@ TADA_CreateUseParamRef <- function(.data, org_id = NULL, paramRef = NULL, usePar
}



#' ATTAINS Assessment Unit and Use Name Crosswalk
#'
#' This function pulls in all prior ATTAINS Use names associated with each
Expand Down Expand Up @@ -2606,7 +2603,6 @@ TADA_CreateUseAURef <- function(.data, org_id = NULL, AUMLRef = NULL, # Required
}



#' Helper Function to Apply Uses to Unassigned Assessment Units by Water Type
#'
#' This is a helper function to TADA_CreateUseAURef and is meant to help users
Expand Down Expand Up @@ -2725,7 +2721,6 @@ TADA_CreateWaterUseRef <- function(.data, org_id = NULL, waterUseRef = NULL) {
}



#' Review and Apply Any Site-specific Criteria to Monitoring Location Sites or Assessment Units
#'
#' This function will pull in all unique MonitoringLocationName, MonitoringLocationType,
Expand Down
16 changes: 4 additions & 12 deletions R/ContinuousDataFunctions.R
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,7 @@ TADA_listNWIS <- function(aoi_sf = "null", statecode = "null", siteid = "null")
err_msg <- as.character(e$message)

# Check for HTTP 404 in the error message
if (grepl("404", err_msg)) {

} else {
if (grepl("404", err_msg)) {} else {
# For any other error, stop with server error message
stop(paste0("Something went wrong:", err_msg, " See https://waterservices.usgs.gov/docs/site-service/site-service-details/#error-codes."))
}
Expand Down Expand Up @@ -302,9 +300,7 @@ TADA_listNWIS <- function(aoi_sf = "null", statecode = "null", siteid = "null")
err_msg <- as.character(e$message)

# Check for HTTP 404 in the error message
if (grepl("404", err_msg)) {

} else {
if (grepl("404", err_msg)) {} else {
# For any other error, stop with server error message
stop(paste0("Something went wrong:", err_msg, " See https://waterservices.usgs.gov/docs/site-service/site-service-details/#error-codes."))
}
Expand Down Expand Up @@ -532,9 +528,7 @@ TADA_getNWIS <- function(aoi_sf = "null", statecode = "null", siteid = "null", p
err_msg <- as.character(e$message)

# Check for HTTP 404 in the error message
if (grepl("404", err_msg)) {

} else {
if (grepl("404", err_msg)) {} else {
# For any other error, stop with server error message
stop(paste0("Something went wrong: ", err_msg, " See https://waterservices.usgs.gov/docs/site-service/site-service-details/#error-codes."))
}
Expand Down Expand Up @@ -579,9 +573,7 @@ TADA_getNWIS <- function(aoi_sf = "null", statecode = "null", siteid = "null", p
err_msg <- as.character(e$message)

# Check for HTTP 404 in the error message
if (grepl("404", err_msg)) {

} else {
if (grepl("404", err_msg)) {} else {
# For any other error, stop with server error message
stop(paste0("Something went wrong:", err_msg, " See https://waterservices.usgs.gov/docs/site-service/site-service-details/#error-codes."))
}
Expand Down
1 change: 0 additions & 1 deletion R/CriteriaComparison.R
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,6 @@ TADA_PairForCriteriaCalc <- function(.data, ref = "null", hours_range = 4) {
dplyr::rename_with(~ paste0("TADA.", group.id, "MethodSpeciationName"), TADA.MethodSpeciationName)



# identify dynamically named columns
pair_char_name <- paste0("TADA.", group.id, "Name")
pair_result_val <- paste0("TADA.", group.id, ".ResultMeasureValue")
Expand Down
1 change: 0 additions & 1 deletion R/CriteriaMethods.R
Original file line number Diff line number Diff line change
Expand Up @@ -988,7 +988,6 @@ TADA_DefineCriteriaMethodology <- function(.data,
}



#' Data Dictionary for Criteria and Methodology
#'
#' Defines and summarizes the column names found in the TADA format for the
Expand Down
1 change: 0 additions & 1 deletion R/Figures.R
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,6 @@ TADA_FieldValuesPie <- function(.data, field = "null", characteristicName = "nul
}



#' Create Scatterplot(s)
#'
#' @param .data TADA dataframe containing the data downloaded from the
Expand Down
5 changes: 0 additions & 5 deletions R/GeospatialFunctions.R
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,6 @@ fetchATTAINS <- function(.data, catchments_only = FALSE) {
)



return(final_features)

# If area is small (< 6e+9 square meters), just use the bbox in one pull:
Expand Down Expand Up @@ -2589,7 +2588,6 @@ TADA_ViewATTAINS <- function(.data, ref_icons = TRUE) {
}



#' Identify and group nearby monitoring locations (UNDER ACTIVE DEVELOPMENT)
#'
#' This function takes a TADA dataset and identifies the NHD catchments that
Expand Down Expand Up @@ -3124,7 +3122,6 @@ TADA_FindNearbySites <- function(.data, dist_buffer = 100,
}



#' Get grouped monitoring stations that are near each other
#'
#' This function takes a TADA dataset that contains grouped nearby monitoring stations
Expand Down Expand Up @@ -3167,7 +3164,6 @@ TADA_GetUniqueNearbySites <- function(.data) {
}



#' Generate a random WQP dataset
#'
#' Retrieves data for a period of time in the past 20 years using
Expand Down Expand Up @@ -3261,7 +3257,6 @@ TADA_RandomTestingData <- function(number_of_days = 1, choose_random_state = FAL
}



#' TADA_CreateAUMLCrosswalk
#'
#' Create the assessment unit and monitoring location ref by utilizing an optional
Expand Down
2 changes: 0 additions & 2 deletions R/RequiredCols.R
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,6 @@ TADA_OrderCols <- function(.data) {
}



#' Get TADA Template
#'
#' This function returns a blank TADA template that can be used as a starting
Expand All @@ -365,7 +364,6 @@ TADA_GetTemplate <- function() {
}



#' TADA Required Fields Check
#'
#' This function checks if all fields required to run TADA functions are included in the input
Expand Down
26 changes: 16 additions & 10 deletions R/ResultFlagsDependent.R
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,12 @@ TADA_FlagFraction <- function(.data, clean = TRUE, flaggedonly = FALSE) {
if (("TADA.SampleFraction.Flag" %in% colnames(.data)) == TRUE) {
.data <- dplyr::select(.data, -TADA.SampleFraction.Flag)
}
# read in sample fraction reference table from extdata and filter
frac.ref <- utils::read.csv(system.file("extdata", "WQXcharValRef.csv", package = "EPATADA")) %>%
dplyr::filter(Type == "CharacteristicFraction")
# read in fraction reference table from extdata and filter
file_path <- system.file("extdata", "WQXcharValRef.rda", package = "EPATADA")
load(file_path)
rm(file_path)
frac.ref <- dplyr::filter(WQXcharValRef, Type == "CharacteristicFraction")
rm(WQXcharValRef)

# join "TADA.WQXVal.Flag" column to .data by CharacteristicName and Value (SampleFraction)
check.data <- merge(.data, frac.ref[, c("Characteristic", "TADA.WQXVal.Flag", "Value")],
Expand Down Expand Up @@ -217,8 +220,11 @@ TADA_FlagSpeciation <- function(.data, clean = c("suspect_only", "nonstandardize
}

# read in speciation reference table from extdata and filter
spec.ref <- utils::read.csv(system.file("extdata", "WQXcharValRef.csv", package = "EPATADA")) %>%
dplyr::filter(Type == "CharacteristicSpeciation")
file_path <- system.file("extdata", "WQXcharValRef.rda", package = "EPATADA")
load(file_path)
rm(file_path)
spec.ref <- dplyr::filter(WQXcharValRef, Type == "CharacteristicSpeciation")
rm(WQXcharValRef)

# join "TADA.WQXVal.Flag" column to .data by CharacteristicName and Value (Speciation)
check.data <- merge(.data, spec.ref[, c("Characteristic", "TADA.WQXVal.Flag", "Value")],
Expand Down Expand Up @@ -299,7 +305,6 @@ TADA_FlagSpeciation <- function(.data, clean = c("suspect_only", "nonstandardize
}



#' Check Result Unit Validity
#'
#' Function checks the validity of each characteristic-media-result unit
Expand Down Expand Up @@ -416,8 +421,11 @@ TADA_FlagResultUnit <- function(.data, clean = c("suspect_only", "nonstandardize
}

# read in unit reference table from extdata and filter
unit.ref <- utils::read.csv(system.file("extdata", "WQXcharValRef.csv", package = "EPATADA")) %>%
dplyr::filter(Type == "CharacteristicUnit")
file_path <- system.file("extdata", "WQXcharValRef.rda", package = "EPATADA")
load(file_path)
rm(file_path)
unit.ref <- dplyr::filter(WQXcharValRef, Type == "CharacteristicUnit")
rm(WQXcharValRef)

# join "TADA.WQXVal.Flag" column to .data by CharacteristicName, Source (Media), and Value (unit)
check.data <- merge(.data, unit.ref[, c("Characteristic", "Source", "TADA.WQXVal.Flag", "Value")],
Expand Down Expand Up @@ -633,7 +641,6 @@ TADA_FindQCActivities <- function(.data, clean = FALSE, flaggedonly = FALSE) {
}



#' Pair Replicates with Original Samples
#'
#' This function looks for replicate samples and pairs them to their original or
Expand Down Expand Up @@ -781,7 +788,6 @@ TADA_PairReplicates <- function(.data, type = c("QC_replicate"), time_difference
}



#' Check for results with suspect result Measure Qualifier Codes
#'
#' This function checks for and flags or removes samples denoted as suspect
Expand Down
Loading
Loading