Skip to contents

This function removes rows where the result value is not numeric to prepare a dataframe for quantitative analyses. Ideally, this function should be run after other data cleaning, QA/QC, and harmonization steps are completed using other TADA package functions, or manually. Specifically, this function removes rows with "Text" and "NA - Not Available" in the TADA.ResultMeasureValueDataTypes.Flag column, or NA in the TADA.ResultMeasureValue column. In addition, this function removes results with QA/QC ActivityTypeCode's. This function also removes any columns not required for TADA workflow where all values are equal to NA. It provides a warning message identifying any TADA required columns containing only NA values.

Usage

TADA_AutoFilter(.data)

Arguments

.data

TADA dataframe

Value

.data with rows non-quantitative and QA/QC results removed

Examples

TADA_filtered <- TADA_AutoFilter(Data_Nutrients_UT)
#> [1] "TADA_Autofilter: removing columns not required for TADA workflow if they contain only NAs."
#> [1] "The following column(s) were removed as they contained only NAs: ActivityDepthAltitudeReferencePointText, ActivityEndDate, ActivityEndTime.Time, ActivityEndTime.TimeZoneCode, SampleAquifer, ResultWeightBasisText, ResultTemperatureBasisText, ResultParticleSizeBasisText, BinaryObjectFileName, BinaryObjectFileTypeCode, LabSamplePreparationUrl and ProjectMonitoringLocationWeightingUrl."
#> [1] "TADA_Autofilter: checking required columns for non-NA values."
#> [1] "TADA Required column(s) SubjectTaxonomicName, SampleTissueAnatomyName, ResultDepthHeightMeasure.MeasureValue, TADA.ResultDepthHeightMeasure.MeasureValue, ResultDepthHeightMeasure.MeasureUnitCode, TADA.ResultDepthHeightMeasure.MeasureUnitCode, ResultDepthAltitudeReferencePointText, ResultTimeBasisText, StatisticalBaseCode, ResultFileUrl, ResultAnalyticalMethod.MethodUrl, DataQuality.PrecisionValue, DataQuality.BiasValue, DataQuality.ConfidenceIntervalValue, DataQuality.UpperConfidenceLimitValue, DataQuality.LowerConfidenceLimitValue, ProjectFileUrl, QAPPApprovalAgencyName and LocalAqfrName contain only NA values. This may impact other TADA functions."
#> [1] "Function removed 3386 results. These results are either text or NA and cannot be plotted or represent quality control activities (not routine samples or measurements)."