plotCdf: plotCDF Function to create CDFs of chla, ts, and cyano

Description Usage Arguments Examples

View source: R/plotCdf.R

Description

This functions produces CDF plots from the hkm2014Data. The implementation may be used more widely though to create cumulative distribution functions for multiple categories

Usage

1
plotCdf(catVar, contVar, cdf_colors = 1:length(catVar), ...)

Arguments

catVar

the categorical Variable such as-'bvCat', 'TS_CHLA_2', 'TS_CHLA_3', 'TS_CHLA_4'. Of same length as contVar

contVar

the continuous Variable such as-'sumBioV','CHLA', 'NTL', 'PTL', etc. Of same length as contVar

cdf_colors

colors for CDF plots and median line -should equal # of categories in catVar + 1

...

pass additional parameters to labs (e.g. set titles, axis labels, etc.)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
devtools::install_github('wesanderson','karthik')
library(wesanderson)
data(LakeTrophicModelling)
plotCdf(ltmData$bvCat,ltmData$CHLA,cdf_colors=wes.palette(3,'Royal1'),y='Percent',
        x=expression(paste('Log10(Chl ', italic("a"),')')),title='CDF for category bvCat',
        color="Biovolume\nCategories")
plotCdf(ltmData$TS_CHLA_3,ltmData$sumBioV+1,cdf_colors=wes.palette(3,'FantasticFox'),
        y='Percent',x='Log10(Cyanobacterial Biovolume)',
        title=expression(paste('CDF for Chlorophyll ', italic("a"),' Trophic States (3 Categories)')),
        color="Trophic State\nCategories")

USEPA/LakeTrophicModelling documentation built on Oct. 15, 2020, 4:13 p.m.