YOWNplot: YOWNplot

View source: R/YOWNplot.R

YOWNplotR Documentation

YOWNplot

Description

[Experimental]

Generalized YOWN plotting function

Usage

YOWNplot(
  AQID,
  timeSeriesID = "Wlevel_bgs.Calculated",
  chartXinterval = "auto",
  dateRange = "all",
  stats = FALSE,
  smooth = FALSE,
  saveTo = "desktop",
  login = Sys.getenv(c("AQUSER", "AQPASS")),
  server = "https://yukon.aquaticinformatics.net/AQUARIUS"
)

Arguments

AQID

YOWN location for which a plot will be generated.

timeSeriesID

Aquarius time series ID exactly as in Aquarius (ie. "Wlevel_bgs.Calculated", "Wlevel_masl.Calculated"). Defaults to m bgs.

chartXinterval

X axis interval, can be specified "auto" for best fit calculation, or as desired (ie. "1 day", "1 month", "1 year", etc.). Defaults to "auto"

dateRange

X axis limits, can be "all" for all data, "1yr" for most recent year of data, or vector of 2 in format c("2020/01/01", "2023/01/01"). Defaults to "all". Does not apply to stats = "line", which always plots the most current year of data.

stats

Can be "line", "ribbon", or FALSE. Line shows years plotted in separate lines, ribbon shows max/min ribbon geom, and FALSE excludes stats. If set to "line", dateRange ignored as most current year of data will be plotted alongside historical data.

smooth

Can be FALSE or a numeric day value (ie. 14) for plotting rolling average.

saveTo

Directory in which the plot will be saved. Can specify "desktop" to automatically create YOWN ID folder on desktop as save directory.

login

Your Aquarius login credentials as a character vector of two (eg. c("cmfische", "password") Default pulls information from your .renviron profile; see details. Passed to WRBtools::aq_download().

server

The URL for your organization's Aquarius web server. Default is for the Yukon Water Resources Branch. Passed to WRBtools::aq_download().

Details

To store login credentials in your .renviron profile, call usethis::edit_r_environ() and enter your username and password as value pairs, as AQUSER="your username" and AQPASS = "your password".

Value

Writes a .pdf containing YOWN data in the specified directory.


YukonWRB/WRBplots documentation built on Sept. 29, 2023, 2:05 p.m.