plot_sedFlow: plot_sedFlow. Create plots of sediment vs. discharge for...

Description Usage Arguments Details Value Examples

View source: R/plot_sedFlow.R

Description

Function to output scatterplots of sediment parameter vs. discharge. Output is list of plots or write to PDF.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
plot_sedFlow(
  x,
  log.P80154 = FALSE,
  log.P70331 = FALSE,
  log.P80225 = FALSE,
  log.P00530 = FALSE,
  log.Q = 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.P80225

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

log.P00530

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

log.Q

Logical, if TRUE, flow x axis will be log10 for all parameters present. 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

Scatterplots of SSC (P80154), sand/silt break (P70331), bedload (P80225), TSS (P00530) vs. flow (all discharge reported or converted to cfs). Not all parameters need to be present in x for plots to be created (eg. if only SSC present than only SSC vs. flow 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.

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
sedFlow <- plot_sedFlow(exampleData, siteSelect = "06934500")
## Not run: 
# view plot in Rstudio
sedFlow$SSC

# output to file on D drive
plot_sedFlow(exampleData, siteSelect = "06934500", PDFout = "D:/flow.pdf")

## End(Not run)

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