waterseries: waterseries

waterseriesR Documentation

waterseries

Description

Produces a time series plot from water data.

Usage

waterseries(
  object,
  parkcode = NA,
  sitecode = NA,
  charname = NA,
  category = NA,
  by = "char",
  assessment = TRUE,
  layers = c("points", "line"),
  xname = NA,
  yname = NA,
  labels = NA,
  title = NULL,
  colors = NA,
  assesscolor = "red",
  sizes = c(3, 0.8, 1.1),
  censored = FALSE,
  deseason = FALSE,
  legend = "bottom",
  webplot = FALSE,
  ...
)

Arguments

object

Either a data.frame that is the output of getWData, a Characteristic object, a Site object, a Park object or a list of such objects.

parkcode

One or more parkcodes, in quotes. If object is a Park object or a list of Park objects, then the parkcode argument can be used to select which sites should be used.

sitecode

One or more sitecodes, in quotes. If object is a Park object or a list of Park or Site objects, then the sitcode argument can be used to select which sites should be used.

charname

Required if object is not a data.frame. Name(s), in quotes, of one or more Characteristics whose data should be graphed.

category

One or more categories of characteristics, in quotes. Only those categories of characteristics will be returned.

by

Indicates how the data for the plot should be grouped. A text variable in quotes. Choices are:

"park"

If more than one park is included in the graph, this will produce a different line for each park.

"site

If more than one site is included in the graph, this will produce a different line for each site.

"category"

If more than one category is included in the graph, this will prodice a different line for each category.

"char"

The default. If more than one characteristic is included in the graph, this will produce a different line for each one.

assessment

Vector indicating if assessment lines will be marked on the graph. See details below.

layers

Defaults to c("points","line") Indicates which layers you wish to see on the plot.

xname

Text, defaults to NA. A label for the x-axis. If a Characteristic, Site, or Park object is passed to object, then the x-label will default to whatever is indicated in by, unless overwritten by the xname argument. If a data.frame is passed then the x-label will either be the text from xname or blank if xname is left as NA.

yname

Text, defaults to NA. A label for the y-axis. If an Characteristic, Site, or Park object is passed to object, then the y-label will default to the Display Name and Units for the Characteristic, unless overwritten by the yname argument. If a data.frame is passed then the y-label will either be the text from yname or blank if yname is left as NA.

labels

A character vector indicating the labels for the data series, defaults to NA. If labels are provided (one for each series) they will be printed. If object is a data.frame and labels is NA then no labels will be printed. If object is a Characteristic, Site, or Park object, and labels is NA then the default will depend on the by argument. "site" will be labeled with the site name from the Site's Display Name slot and "park" with the Park's short name from the ShortName slot.

title

A title in the graph in quotes. Defaults to NULL, which indicates no title should be used.

colors

a character vector with the colors for the points and lines.

assesscolor

a length one character vector with the color for the assessment lines.

sizes

a length 3 numeric vector with the sizes for the points, line connecting the points and assessment lines.

censored

If FALSE assumes all data points are true measurements. If TRUE plots the minimum or maximum quantification limit and color codes to distinguish true measurements from detection limits. Defaults to FALSE.

deseason

If FALSE will plot all data points on the same figure. If TRUE will split plots by month. Defaults to FALSE.

legend

a vector indicating where the legend position. Can be: "none","left","right","top","bottom" or a two element numeric vector.

webplot

If TRUE, the plot is produced using ggploty from the ploty package. Will produce a html plot with interactive features.

...

Additional arguments used to select and filter data passed to getWData

Details

The assessment argument determines if lines representing the assessment values should be drawn on the graph. If FALSE then no lines will be drawn. If TRUE, the default, then the upper and lower points indicated in object's Character objects will be used to draw the lines. Note that if there are multiple assessment points, for example if different parks have different points, or if there is both an upper and lower point, they will all be drawn. If a vector of numbers is passed to assessment instead then those will serve as the assessment values and lines will be drawn accordingly. Note that if object is a data.frame then the only way to draw assessment lines is by passing a numeric vector to assessment.

Value

Creates a time series plot.


NCRN/NCRNWater documentation built on May 15, 2023, 9:50 p.m.