TADA_Scatterplot | R Documentation |
Create Scatterplot(s)
TADA_Scatterplot(.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. The 'TADA.ComparableDataIdentifier' column is added to the dataframe automatically when WQP data is retrieved using TADADataRetrieval. This TADA.ComparableDataIdentifier can be updated to harmonize synonyms by running the function TADA_HarmonizeSynonyms(). You can also include additional grouping columns in the id_cols input if desired. If more than one TADA.ComparableDataIdentifier exists in the dataset, the function creates a list of plots, where each list element name is a unique TADA.ComparableDataIdentifier. |
id_cols |
The column(s) in the dataset used to identify the unique groups to be plotted. Defaults to 'TADA.ComparableDataIdentifier'. |
A list of plotly scatterplot figures showing the distribution of sample values for each comparable data group (TADA.ComparableDataIdentifier).
# Load example dataset:
data(Data_6Tribes_5y_Harmonized)
# Create a scatterplot for each comparable data group (TADA.ComparableDataIdentifier)
# in the input dataframe:
TADA_Scatterplot(Data_6Tribes_5y_Harmonized, id_cols = "TADA.ComparableDataIdentifier")
# Create a single scatterplot 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_Scatterplot(df, id_cols = "TADA.ComparableDataIdentifier")
# Creates a scatterplot for each monitoring location
TADA_Scatterplot(df, id_cols = c("TADA.ComparableDataIdentifier", "MonitoringLocationName"))
# Create multiple scatterplots 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 dataset:
data(Data_Nutrients_UT)
Scatterplot_output <- TADA_Scatterplot(Data_Nutrients_UT,
id_cols = c("TADA.ComparableDataIdentifier", "MonitoringLocationTypeName")
)
# This example generates 47 scatterplots
Scatterplot_output[[10]]
Scatterplot_output[[25]]
Scatterplot_output[[35]]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.