View source: R/plotWQ_ByCycle.r
plotWQ_byCycle | R Documentation |
Plot PAWMAP water quality data by watershed.
plotWQ_byCycle(
dfm,
result = "numeric_result",
analyte_field = "janus_analyte_name",
analyte_units = "analyte_units",
storm = "storm",
stationInfo = TRUE
)
dfm |
The data frame containing the variable |
result |
the field containing the numeric value |
analyte_field |
the field containing the name of the water quality analyte |
analyte_units |
the field containing the analyte measurement units |
storm |
the field indicating seasonal or storm samples |
stationInfo |
should station information be added to the data? If not, a field named 'watershed' is required. |
A ggplot box plot of the variable plotted by sampling cycle
library(ggplot2)
stations <- unique(stationInfo$site_identifier)
num_stations <- length(stations)
d <- data.frame(site_identifier=stations, janus_analyte_name='copper',
numeric_result=rlnorm(num_stations), storm='Seasonal',
analyte_units = 'ug/L',
cycle=replicate(num_stations, sample(c(1,2), 1)))
d <- rbind(d, data.frame(site_identifier=stations, janus_analyte_name='copper',
numeric_result=2*rlnorm(num_stations), storm='Storm',
analyte_units = 'ug/L',
cycle=replicate(num_stations, sample(c(1,2), 1))))
p <- plotWQ_byCycle(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.