Takes as an input a data frame with date and up to 8 columns of parameter data. Column names are Date and SiteIDs and values are daily means for some measurement.

CompSiteCDF(
  file.input = NULL,
  dir.input = getwd(),
  dir.output = getwd(),
  ParamName.xlab,
  df.input = NULL
)

Arguments

file.input

Input data as CSV. Needs Date column and it will handle up to 5 SiteIDs (with data under each SiteID).

dir.input

Directory where data file is located. Default is the working directory; getwd().

dir.output

Directory where PDF file is to be saved. Default is the working directory; getwd().

ParamName.xlab

Parameter name for x-axis on plots

df.input

Optionally use existing data frame over importing file.input. Default = NULL (import file.input).

Value

Returns a PDF of CDFs.

Details

More than 8 columns can be used but colors are recycled after 8 and the plot lines will be difficult to distinguish.

CDFs are generate for all data, year, season, and year/season and saved to a PDF. Winter + Year is such that December is included with the following year (e.g., Dec 2013, Jan 2014, Feb 2014 are 2014Winter).

Two plots per page are generated. The first plot is the proportion of values at a certain value. This plot is similar to a histogram. The second plot is a CDF of values. The line represents the proportion of values less than or equal to parameter values on the x-axis.

Examples

# Variant 1 (with File)
# Load Data
myFile <- "CDF_WaterTemp_2014_MA.csv"
# example file from ContDataQC library files
myDir.input <- file.path(path.package("ContDataQC"),"extdata")
myDir.output <- tempdir()
# X Label
myXlab <- "Temperature, Water (deg C)"
# Run the Function
CompSiteCDF(file.input = myFile
           , dir.input = myDir.input
           , dir.output = myDir.output
           , ParamName.xlab = myXlab)
#> PDF created:
#> /var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T//RtmpZn7gXz
#> CompSiteCDF_20221222_201022.pdf

# Variant 2 (with Data Frame)
# Load Data
myDF <- data_CompSiteCDF
# X Label
myXlab <- "Temperature, Water (deg C)"
# Run the Function
# (output will default to working directory if not specified)
CompSiteCDF(ParamName.xlab = myXlab
            , df.input = myDF
            , dir.output = tempdir())
#> PDF created:
#> /var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T//RtmpZn7gXz
#> CompSiteCDF_20221222_201022.pdf