plotWQ_byWat: Plot PAWMAP water quality data by watershed.

View source: R/plotWQ_ByWat.r

plotWQ_byWatR Documentation

Plot PAWMAP water quality data by watershed.

Description

Plot PAWMAP water quality data by watershed.

Usage

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

Arguments

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.

Value

A ggplot box plot of the variable by watershed

Examples

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

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