Skip to contents

Function creates a table yielding the number of unique values in each field (column) returned. The first column of the summary table holds the field name and the second column holds the unique value count.

Usage

TADA_FieldCounts(
  .data,
  display = c("key", "most", "all"),
  characteristicName = "null"
)

Arguments

.data

TADA dataframe

display

A character string denoting what fields to return in the summary table. Defaults to "key". "all" will return all fields in the dataset, "most" will return most field names except those holding numeric values or units, and "key" returns the most important columns to review. Note that if a field is completely NA, it will not be shown on the summary table.

characteristicName

Optional. Defaults to "null". A vector of TADA-converted (all caps) WQP characteristics a user may provide to filter the results to one or more characteristics of interest. "null" will show a summary table for the whole dataset.

Value

A summary table yielding the number of unique values in each field.

Examples

# Load example dataset:
data(Data_Nutrients_UT)
# Count table of key fields in Data_Nutrients_UT dataset
fieldCountUT <- TADA_FieldCounts(Data_Nutrients_UT)
# Count table of most fields in Data_Nutrients_UT, filtered to only AMMONIA results.
fieldCountUTAmmonia <- TADA_FieldCounts(Data_Nutrients_UT, display = "most", characteristicName = "AMMONIA")