TADA_Histogram | R Documentation |
Create Histogram(s)
TADA_Histogram(.data, id_cols = c("TADA.ComparableDataIdentifier"))
.data |
TADA dataframe containing the data downloaded from the WQP, where each row represents a unique data record. Dataframe 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 dataframe (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 dataframe used to identify the unique groups to be plotted. Defaults to 'TADA.ComparableDataIdentifier'. |
A list of plotly histogram figures showing the distribution of sample values for each data group.
# Load example dataframe:
data(Data_6Tribes_5y_Harmonized)
# Create a histogram for each comparable data group (TADA.ComparableDataIdentifier)
# in the input dataframe:
TADA_Histogram(Data_6Tribes_5y_Harmonized, id_cols = "TADA.ComparableDataIdentifier")
# Create a single histogram using defaults. The input dataframe 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 dataframe:
data(Data_Nutrients_UT)
Histogram_output <- TADA_Histogram(Data_Nutrients_UT,
id_cols = c(
"TADA.ComparableDataIdentifier",
"MonitoringLocationTypeName"
)
)
# This example generates 32 histograms
Histogram_output[[10]]
Histogram_output[[25]]
Histogram_output[[30]]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.