Create Histogram(s)
Usage
TADA_Histogram(.data, id_cols = c("TADA.ComparableDataIdentifier"))
Arguments
- .data
TADA data frame containing the data downloaded from the WQP, where each row represents a unique data record. Data frame must include the columns 'TADA.ComparableDataIdentifier', 'TADA.ResultMeasureValue', and 'TADA.ResultMeasure.MeasureUnitCode' to run this function. 'TADA.ComparableDataIdentifier' can be added to the data frame by running the function TADA_HarmonizeSynonyms(). The user can include additional grouping columns in the id_cols input. If more than one group exists in the data frame (i.e. two or more unique comparable data identifiers), the function creates a list of plots, where each list element name is a unique group identifier.
- id_cols
The column(S) in the data frame used to identify the unique groups to be plotted. Defaults to 'TADA.ComparableDataIdentifier'.
Value
A list of plotly histogram figures showing the distribution of sample values for each data group.
Examples
# Load example data frame:
data(Data_6Tribes_5y_Harmonized)
# Create a histogram for each comparable data group (TADA.ComparableDataIdentifier)
# in the input data frame:
TADA_Histogram(Data_6Tribes_5y_Harmonized, id_cols = "TADA.ComparableDataIdentifier")
#> $`ALKALINITY, TOTAL TOTAL AS CACO3 PCU`
#>
#> $`ALKALINITY TOTAL AS CACO3 UG/L`
#>
#> $`ALPHA PARTICLE DISSOLVED PCI/L`
#>
#> $`ALPHA PARTICLE PCI/L`
#>
#> $`ALPHA PARTICLE TOTAL PCI/L`
#>
#> $`ALUMINUM DISSOLVED UG/L`
#>
#> $`AMMONIA FILTERED AS N MG/L`
#>
#> $`AMMONIA UNFILTERED AS N MG/L`
#>
#> $`AMMONIUM UNFILTERED AS N MG/L`
#>
#> $`APPARENT COLOR PCU`
#>
#> $`APPARENT COLOR TOTAL PCU`
#>
#> $`ARSENIC DISSOLVED UG/L`
#>
#> $`ARSENIC TOTAL UG/L`
#>
#> $`BARIUM DISSOLVED UG/L`
#>
#> $`BAROMETRIC PRESSURE G/M2`
#>
#> $`BIOCHEMICAL OXYGEN DEMAND, STANDARD CONDITIONS TOTAL UG/L`
#>
#> $`CADMIUM TOTAL UG/L`
#>
#> $`CALCIUM DISSOLVED UG/L`
#>
#> $`CHEMICAL OXYGEN DEMAND TOTAL UG/L`
#>
#> $`CHLORIDE TOTAL UG/L`
#>
#> $`CHLOROPHYLL A, CORRECTED FOR PHEOPHYTIN SUSPENDED UG/L`
#>
#> $`CHLOROPHYLL A UG/L`
#>
#> $`CHLOROPHYLL A UNFILTERED UG/L`
#>
#> $`CHLOROPHYLL/PHEOPHYTIN RATIO UG/KG`
#>
#> $`CHROMIUM TOTAL UG/L`
#>
#> $`CLOUD COVER %`
#>
#> $`CONDITION CLASS (DISSOLVED OXYGEN (DO)) %`
#>
#> $`CONDUCTIVITY US/CM`
#>
#> $`COPPER DISSOLVED UG/L`
#>
#> $`COPPER TOTAL UG/L`
#>
#> $`COUNT COUNT`
#>
#> $`CYANIDE TOTAL UG/L`
#>
#> $`DEPTH, BOTTOM IN`
#>
#> $`DEPTH, SECCHI DISK DEPTH M`
#>
#> $`DEPTH, SNOW COVER IN`
#>
#> $`DEPTH M`
#>
#> $`DISCHARGE, RIVER/STREAM CFS`
#>
#> $`DISSOLVED OXYGEN (DO) MG/L`
#>
#> $`DISSOLVED OXYGEN SATURATION %`
#>
#> $`DISSOLVED OXYGEN UPTAKE UG/L`
#>
#> $`ESCHERICHIA COLI CFU/100ML`
#>
#> $`ESCHERICHIA COLI MPN`
#>
#> $`EXTRACTABLE ORGANIC MATTER (EOM) %`
#>
#> $`EXTRACTABLE ORGANIC MATTER (EOM) G/M2`
#>
#> $`FLOW CFS`
#>
#> $`FLUORIDE TOTAL UG/L`
#>
#> $FUNGI
#>
#> $`HARDNESS, CA, MG TOTAL MG/L`
#>
#> $`HARDNESS, CARBONATE AS CACO3 UG/L`
#>
#> $`HARDNESS, CARBONATE UG/L`
#>
#> $`HARDNESS, CARBONATE TOTAL AS CACO3 UG/L`
#>
#> $`HARDNESS, CARBONATE TOTAL UG/L`
#>
#> $`HEIGHT, GAGE M`
#>
#> $`ICE THICKNESS IN`
#>
#> $`IRON DISSOLVED UG/L`
#>
#> $`IRON TOTAL UG/KG`
#>
#> $`IRON TOTAL UG/L`
#>
#> $`KJELDAHL NITROGEN TOTAL RECOVERABLE MG/L`
#>
#> $`LEAD TOTAL UG/L`
#>
#> $`LENGTH, TOTAL (FISH) IN`
#>
#> $`LOONS, VISUAL OBSERVATION COUNT`
#>
#> $`MAGNESIUM DISSOLVED UG/L`
#>
#> $`MANGANESE DISSOLVED UG/L`
#>
#> $`MANGANESE TOTAL UG/L`
#>
#> $`MERCURY DISSOLVED UG/L`
#>
#> $`MERCURY TOTAL UG/L`
#>
#> $`MERCURY UNFILTERED UG/L`
#>
#> $`METHYLMERCURY(1+) UNFILTERED UG/L`
#>
#> $`MOISTURE CONTENT %`
#>
#> $`NICKEL TOTAL UG/L`
#>
#> $`NITRATE + NITRITE FILTERED AS N MG/L`
#>
#> $`NITRATE + NITRITE INORGANIC AS NO3 MG/L`
#>
#> $`NITRATE + NITRITE UNFILTERED AS N MG/L`
#>
#> $`NITRATE UNFILTERED AS N MG/L`
#>
#> $`NITRATE UNFILTERED MG/L`
#>
#> $`NITRITE UNFILTERED AS N MG/L`
#>
#> $`NITRITE UNFILTERED MG/L`
#>
#> $`NON-VIABLE SEED COUNT COUNT`
#>
#> $`NON-VIABLE SEED WEIGHT G`
#>
#> $`NUMBER OF SEEDS WITH ERGOTS COUNT`
#>
#> $`NUMBER OF SEEDS WITH WORM HOLES COUNT`
#>
#> $`NUMBER OF STALKS PER SAMPLE PLANT COUNT`
#>
#> $`ORGANIC CARBON DISSOLVED UG/L`
#>
#> $`ORGANIC CARBON TOTAL UG/L`
#>
#> $`ORTHOPHOSPHATE FILTERED AS P UG/L`
#>
#> $`ORTHOPHOSPHATE TOTAL RECOVERABLE AS P UG/L`
#>
#> $`ORTHOPHOSPHATE UNFILTERED AS P UG/L`
#>
#> $`PERIPHYTON G/M2`
#>
#> $`PHEOPHYTIN A TOTAL UG/L`
#>
#> $PH
#>
#> $`PLANT HEIGHT (ABOVE WATER) IN`
#>
#> $`PLANT HEIGHT (TOTAL) IN`
#>
#> $`POTASSIUM DISSOLVED UG/L`
#>
#> $`PRESSURE G/M2`
#>
#> $`PRESSURE MMHG`
#>
#> $`RADIUM-226 PCI/L`
#>
#> $`RADIUM-226 TOTAL PCI/L`
#>
#> $`RADIUM-228 PCI/L`
#>
#> $`ROOT WEIGHT G`
#>
#> $`SALINITY PSS`
#>
#> $`SELENIUM TOTAL UG/L`
#>
#> $`SHOOT WEIGHT G`
#>
#> $`SILICON TOTAL UG/L`
#>
#> $`SODIUM DISSOLVED UG/L`
#>
#> $`SPECIFIC CONDUCTANCE US/CM`
#>
#> $`STREAM STAGE M`
#>
#> $`STREAM WIDTH MEASURE M`
#>
#> $`SULFATE TOTAL AS SO4 UG/L`
#>
#> $`SULFATE TOTAL UG/L`
#>
#> $`TEMPERATURE, AIR DEG C`
#>
#> $`TEMPERATURE, SAMPLE DEG C`
#>
#> $`TEMPERATURE DEG C`
#>
#> $`TOTAL DISSOLVED SOLIDS UG/KG`
#>
#> $`TOTAL DISSOLVED SOLIDS UG/L`
#>
#> $`TOTAL DISSOLVED SOLIDS TOTAL UG/L`
#>
#> $`TOTAL HARDNESS TOTAL AS CACO3 MG/L`
#>
#> $`TOTAL HARDNESS TOTAL MG/L`
#>
#> $`TOTAL KJELDAHL NITROGEN (ORGANIC N & NH3) UNFILTERED AS N MG/L`
#>
#> $`TOTAL KJELDAHL NITROGEN (ORGANIC N & NH3) UNFILTERED MG/L`
#>
#> $`TOTAL NITROGEN, MIXED FORMS UNFILTERED AS N MG/L`
#>
#> $`TOTAL PHOSPHORUS, MIXED FORMS FILTERED AS P UG/L`
#>
#> $`TOTAL PHOSPHORUS, MIXED FORMS UNFILTERED AS P UG/L`
#>
#> $`TOTAL SAMPLE WEIGHT G`
#>
#> $`TOTAL SUSPENDED SOLIDS NON-FILTERABLE (PARTICLE) UG/L`
#>
#> $`TRANSPARENCY, SECCHI TUBE WITH DISK IN`
#>
#> $`TRITIUM PCI/L`
#>
#> $`TRUE COLOR PCU`
#>
#> $`TURBIDITY FIELD NTU`
#>
#> $`TURBIDITY NTU`
#>
#> $`URANIUM DISSOLVED UG/L`
#>
#> $`VIABLE SEED COUNT COUNT`
#>
#> $`VIABLE SEED WEIGHT G`
#>
#> $`VOLATILE SUSPENDED SOLIDS TOTAL UG/L`
#>
#> $`WIND VELOCITY M/SEC`
#>
#> $`ZINC DISSOLVED UG/L`
#>
#> $`ZINC TOTAL UG/L`
#>
# Create a single histogram using defaults. The input data frame in this example
# is filtered so it includes only one TADA.ComparableDataIdentifier
df <- dplyr::filter(Data_6Tribes_5y_Harmonized, TADA.ComparableDataIdentifier == "TOTAL PHOSPHORUS, MIXED FORMS_UNFILTERED_AS P_UG/L")
TADA_Histogram(df, id_cols = "TADA.ComparableDataIdentifier")
# Create multiple histograms with additional grouping columns and view the first
# plot in list. In this example, we will group by both TADA.ComparableDataIdentifier
# and MonitoringLocationTypeName (e.g. stream, reservoir, canal, etc.)
# Load example data frame:
data(Data_Nutrients_UT)
Histogram_output <- TADA_Histogram(Data_Nutrients_UT, id_cols = c("TADA.ComparableDataIdentifier", "MonitoringLocationTypeName"))
#> [1] "Plotting function removed 2556 results where TADA.ResultMeasureValue = NA. These results cannot be plotted."
# This example generates 32 histograms
Histogram_output[[10]]
Histogram_output[[25]]
Histogram_output[[30]]