plot_sedTS: plot_sedTS. Create timeseries plots for sediment parameters.

Description Usage Arguments Details Value Examples

View source: R/plot_sedTS.R

Description

Function to output timeseries plots for sediment parameters. Output is a list of plots or write to PDF.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
plot_sedTS(
  x,
  log.P80154 = FALSE,
  log.P70331 = FALSE,
  log.P80155 = FALSE,
  log.P80225 = FALSE,
  log.P91145 = FALSE,
  log.P00530 = FALSE,
  siteSelect = NULL,
  PDFout = NULL
)

Arguments

x

A dataframe output from get_localNWIS

log.P80154

Logical, if TRUE, SSC y axis will be log10. Default is FALSE.

log.P70331

Logical, if TRUE, sand/silt break y axis will be log10. Default is FALSE.

log.P80155

Logical, if TRUE, SSL y axis will be log10. Default is FALSE.

log.P80225

Logical, if TRUE, bedload y axis will be log10. Default is FALSE.

log.P91145

Logical, if TRUE, bedload mass y axis will be log10. Default is FALSE.

log.P00530

Logical, if TRUE, TSS y axis will be log10. Default is FALSE.

siteSelect

Character, site number to create plots for if x contains multiple sites. Default is NULL.

PDFout

Character. File or full path name of file for plots. If NULL, the default, a list of the plots will be returned in R instead.

Details

Timeseries plots of SSC (P80154), sand/silt break (P70331), SSL (P80155), bedload (P80255), bedload mass (P91145) and TSS (P00530). Not all parameters need to be present in x for plots to be created (eg. if only SSC present than only SSC timeseries plot returned)

If PDFout is not specified, than a list of the plots is returned. Plots (if applicable) are specified above. See example for more details.

Portions of code modified from WQReview::qwtsPlot.

Value

If PDFout = NULL, list containing ggplot elements. If PDFout specified, a PDF document containing the plots.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
data("exampleData",package="sedReview")
x <- exampleData
sedTS <- plot_sedTS(exampleData, siteSelect = "05586300")
## Not run: 
# view plot in Rstudio
sedTS$SSC

# output to file on D drive
plot_sedTS(exampleData, siteSelect = "05586300", PDFout = "D:/timeseries.pdf")

## End(Not run)

USGS-R/sedReview documentation built on Aug. 24, 2020, 9 p.m.