plotWQ_byCycle: Plot PAWMAP water quality data by watershed.

View source: R/plotWQ_ByCycle.r

plotWQ_byCycleR Documentation

Plot PAWMAP water quality data by watershed.

Description

Plot PAWMAP water quality data by watershed.

Usage

plotWQ_byCycle(
  dfm,
  result = "numeric_result",
  analyte_field = "janus_analyte_name",
  analyte_units = "analyte_units",
  storm = "storm",
  stationInfo = TRUE
)

Arguments

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.

Value

A ggplot box plot of the variable plotted by sampling cycle

Examples

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')

PDXChris/pmtools documentation built on March 26, 2024, 8:13 a.m.