plotWQ_InWat: Plot PAWMAP Water Quality Data for each station within a...

View source: R/plotWQ_InWat.r

plotWQ_InWatR Documentation

Plot PAWMAP Water Quality Data for each station within a selected watershed.

Description

Plot PAWMAP Water Quality Data for each station within a selected watershed.

Usage

plotWQ_InWat(
  indf,
  wat,
  analyte_field = "janus_analyte_name",
  result = "numeric_result",
  analyte_units = "analyte_units",
  storm = "storm_affected",
  storm.value = "Yes",
  geo.mean = FALSE
)

Arguments

indf

The data frame containing the variable to be plotted

wat

The watershed for which station data will be plotted

analyte_field

The field containing the name of the analyte

result

The field storing the numeric value

analyte_units

The field containing the measurement units

storm

The field indicating whether it is a storm or seasonal sample

storm.value

The value indicating it is a storm sample

geo.mean

Should the geometric mean be used instead of the arithmetic?

Value

A ggplot dot plot of the variable at each station within a watershed

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_affected='No',
                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_affected='Yes',
                 cycle=replicate(num_stations, sample(c(1,2), 1))))
d <- mergeStatInfo(d)
p <- plotWQ_InWat(d, 'Johnson Creek')
p + ggtitle('Copper - Generated Data for Example\n')

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