View source: R/ResultFlagsIndependent.R
TADA_FlagMethod | R Documentation |
Function checks the validity of each characteristic-analytical method combination in the dataframe. When clean = TRUE, rows with Suspect characteristic-analytical method combinations are removed. Default is clean = FALSE. When flaggedonly = TRUE, dataframe is filtered to show only Suspect characteristic-analytical method combinations. Default is flaggedonly = FALSE.
TADA_FlagMethod(.data, clean = FALSE, flaggedonly = FALSE)
.data |
TADA dataframe |
clean |
Boolean argument; removes "Suspect" characteristic-analytical method combinations from the dataframe when clean = TRUE. Default is clean = FALSE. |
flaggedonly |
Boolean argument; filters dataframe to show only "Suspect" characteristic-analytical method combinations when flaggedonly = TRUE. Default is flaggedonly = FALSE. |
The “Not Reviewed” value within "TADA.AnalyticalMethod.Flag" means that the EPA WQX team has not yet reviewed the combinations (see https://cdx.epa.gov/wqx/download/DomainValues/QAQCCharacteristicValidation.CSV). The WQX team plans to review and update these new combinations quarterly.
This function adds the TADA.AnalyticalMethod.Flag to a TADA dataframe. This column flags Suspect CharacteristicName, ResultAnalyticalMethod/MethodIdentifier, and ResultAnalyticalMethod/MethodIdentifierContext combinations in your dataframe as either "Not Reviewed", "Suspect", or "Pass". When clean = FALSE and flaggedonly = TRUE, the dataframe is filtered to show only "Suspect" characteristic-analytical method combinations; the column TADA.AnalyticalMethod.Flag is still appended. When clean = TRUE and flaggedonly = FALSE, "Suspect" rows are removed from the dataframe and no column will be appended.
# Load example dataset
data(Data_NCTCShepherdstown_HUC12)
# Remove Suspect characteristic-analytical method combinations from
# dataframe:
SuspectMethod_clean <- TADA_FlagMethod(Data_NCTCShepherdstown_HUC12,
clean = TRUE
)
# Flag, but do not remove, Suspect characteristic-analytical method
# combinations
# in new column titled "TADA.AnalyticalMethod.Flag":
SuspectMethod_flags <- TADA_FlagMethod(Data_NCTCShepherdstown_HUC12,
clean = FALSE
)
# Show only Suspect characteristic-analytical method combinations:
SuspectMethod_flaggedonly <- TADA_FlagMethod(Data_NCTCShepherdstown_HUC12,
clean = FALSE, flaggedonly = TRUE
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.