Skip to contents

This is a shortcut function to run all of the most important flagging functions on a TADA dataset. See ?function documentation for TADA_FlagResultUnit, TADA_FlagFraction, TADA_FindQCActivities, and TADA_FlagSpeciation for more information.

Usage

TADA_RunKeyFlagFunctions(.data, remove_na = TRUE, clean = TRUE)

Arguments

.data

A TADA dataframe

remove_na

Boolean, Determines whether to keep TADA.ResultMeasureValues that are NA. Defaults to TRUE.

clean

Boolean. Determines whether to keep the Suspect rows in the dataset following each flagging function. Defaults to TRUE.

Value

A TADA dataframe with the following flagging columns:TADA.ResultUnit.Flag, TADA.MethodSpeciation.Flag, TADA.SampleFraction.Flag, and TADA.ActivityType.Flag

Examples

# Load example dataset
data(Data_6Tribes_5y)
# Run flagging functions, keeping all rows
Data_6Tribes_5y_ALL <- TADA_RunKeyFlagFunctions(Data_6Tribes_5y, remove_na = FALSE, clean = FALSE)
#> [1] "Rows with Suspect result value units have been flagged but retained. Review these rows before proceeding and/or set clean = 'suspect_only' or 'both'."
#> [1] "Rows with Suspect sample fractions have been flagged but retained. Review these rows before proceeding and/or set clean = TRUE."
#> [1] "Rows with Suspect speciations have been flagged but retained. Review these rows before proceeding and/or set clean = 'suspect_only' or 'both'."

# Run flagging functions, removing NA's and Suspect rows
Data_6Tribes_5y_CLEAN <- TADA_RunKeyFlagFunctions(Data_6Tribes_5y, remove_na = TRUE, clean = TRUE)
#> [1] "Quality control samples have been removed or were not present in the input dataframe. Returning dataframe with TADA.ActivityType.Flag column for tracking."