plot_SSCTSS: plot_SSCTSS. Plot individual and side-by-side boxplots for...

Description Usage Arguments Details Value Examples

View source: R/plot_SSCTSS.R

Description

Function to output individual and side-by-side boxplots, and scatterplot, for SSC and TSS at a site. Output is a list of plots or write to PDF.

Usage

1
plot_SSCTSS(x, siteSelect = NULL, PDFout = NULL)

Arguments

x

A dataframe output from get_localNWIS

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

Boxplots of SSC (P80154) and TSS (P00530). Box contains lower, median, and upper quartile. Whiskers extend to farthest point within +/- 1.5 IQR. Any points outside of +/- 1.5 IQR are plotted as outlier points. Boxplots in the side-by-side plot are set to a common axis range. Both parameters do not need to be present in x for plots to be created (eg. if only SSC present then only a boxplot of SSC is returned)

If PDFout is not specified, than a list of the plots is returned. Plots (if applicable) are boxplot of SSC, boxplot of TSS, side-by-side boxplot of SSC and TSS, and a SSC vs. TSS scatterplot of samples with both analyses. See example for more details.

Portions of code modified from WQReview::qwparmBoxPlot.

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 <- exampleData2
ssctss <- plot_SSCTSS(exampleData2, siteSelect = "09163500")
## Not run: 
# view plot in Rstudio
ssctss$combined

# output to file on D drive
plot_ssctss(exampleData2, siteSelect = "09163500", PDFout = "D:/ssctss.pdf")

## End(Not run)

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