waterbands: waterbands

waterbandsR Documentation

waterbands

Description

Produces a plot that summarizes the range of historic data and compares with current measurements.

Usage

waterbands(
  object,
  parkcode = NA,
  sitecode = NA,
  charname = NA,
  category = NA,
  year_current = NA,
  year_historic = NA,
  months = c(5:10),
  assessment = TRUE,
  param_name = NA,
  unit = NA,
  yname = NA,
  legend = "bottom",
  ...
)

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.

year_current

Year that will be plotted separately. Must be numeric and 4 digits.

year_historic

First year to include in historic range calculations. Last year will be the year prior to year_current. Must be numeric and 4 digits.

months

A numeric vector corresponding to months of the year. Only data from those months will be returned. Ranges from 1 to 12. Default is c(5:10) for May to October.

assessment

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

param_name

Text, defaults to NA. Used for plotly tooltips

unit

Text, defaults to NA. Note that the function currently can't handle special characters. Used for plotly tooltips

yname

Text, defaults to NA. Used for y axis title

legend

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

...

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 assessemnt 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 plot that compares current with historic ranges. If the minimum or maximum values return a tie, the most recent year is returned.

Examples


netnwd <- importNCRNWater(Dir = "~/Data/NETN", 
                          Data = "Water Data.csv", MetaData = "VizMetaData.csv")
parkcode = "MABI"
sitecode = "NETN_MABI_PA00"
charname = "pH"

waterbands(netnwd, parkcode = parkcode, sitecode = sitecode, charname = charname,
           year_historic = 2006, year_current = 2019, months = c(5:10), 
           assessment = TRUE)



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