plotWQ_byWat | R Documentation |
Plot PAWMAP water quality data by watershed.
plotWQ_byWat(
dfm,
result = "numeric_result",
analyte_field = "janus_analyte_name",
analyte_units = "analyte_units",
storm = "storm_affected",
stationInfo = TRUE
)
dfm |
The data frame containing the variable |
result |
the name of the water quality variable to plot |
analyte_field |
the field containing the name of the analyte |
analyte_units |
the field containing the analyte measurement units |
storm |
the field indicating whether the sample was collected during storm or non-storm conditions |
stationInfo |
should station information be added to the data? If not, a field named 'watershed' is required. |
A ggplot box plot of the variable by watershed
library(ggplot2)
d <- data.frame(site_identifier=unique(stationInfo$site_identifier), janus_analyte_name='copper',
numeric_result=rlnorm(length(stationInfo$site_identifier)), storm_affected='No',
analyte_units = 'ug/L')
d <- rbind(d, data.frame(site_identifier=unique(stationInfo$site_identifier), janus_analyte_name='copper',
numeric_result=2*rlnorm(length(stationInfo$site_identifier)), storm_affected='Yes',
analyte_units = 'ug/L'))
p <- plotWQ_byWat(d)
p + ggtitle('Copper - Generated Data for Example\n')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.