watersite_comps: watersite_comps

watersite_compsR Documentation

watersite_comps

Description

Produces a plot that compares multiple sites for a given year and parameter, with each site having a different color and shape.

Usage

watersite_comps(
  object,
  parkcode = NA,
  sitecode = NA,
  charname = NA,
  category = NA,
  year = NA,
  months = c(5:10),
  param_name = NA,
  unit = NA,
  yname = NA,
  legend = "bottom",
  layers = c("points", "line"),
  assessment = TRUE,
  ...
)

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

Year of data that will be plotted for all sites. 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.

param_name

Text, defaults to NA. Used for plotly tooltips

unit

Text, defaults to NA. 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.

layers

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

assessment

Vector indicating if assessment lines will be marked on the graph. If multiple thresholds exist among the sites plotted, all will be plotted. See details below.

...

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 multiple sites for a given year.

Examples


netnwd <- importNCRNWater(Dir = "~/Data/NETN", 
                          Data = "Water Data.csv", MetaData = "VizMetaData.csv")
parkcode = "MABI"
charname = "pH"
site_list <- getSiteInfo(netnwd, parkcode = parkcode, info = "SiteCode")

watersite_comps(netnwd, parkcode = parkcode, sitecode = site_list, charname = charname,
                year = 2019, months = c(5:10), legend = "none", 
                layers = c("points", "line"), assessment = TRUE)



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