pdf2: Overlay two simple histograms (pdf=probability density...

View source: R/pdf2.R

pdf2R Documentation

Overlay two simple histograms (pdf=probability density functions, not pdf filetype)

Description

Overlay two simple histograms, for data below vs above a cutoff

Usage

pdf2(x, binx, threshold, n = 100, colors = c("gray", "red"), ...)

Arguments

x

Variable for histogram

binx

Variable that defines subsets

threshold

Variable that defines cutoff, so binx<threshold is plotted first, in one color, then binx>=threshold in other color is drawn over that

n

Default is 100. n is just passed to the hist function.

colors

Character vector length 2, with colors for first and second histogram

...

Other named parameters sent to hist, such as main, xlab, ylab

Value

Just plots using hist.

Examples

  ## Not run: 

 e <- bg$pm[!is.na(bg$pm)]
 dpct <- bg$pctmin
 dcount   <- bg$pop[!is.na(bg$pm)] *      dpct[!is.na(bg$pm)]
 refcount <- bg$pop[!is.na(bg$pm)] * (1 - dpct[!is.na(bg$pm)])
 brks <- 0:17
 etxt <- 'PM2.5'
 dtxt <- 'Minorities'

 pop.cdf(        e, pcts = dpct, pops = bg$pop)
 pop.cdf2(       e, dcount, refcount, etxt, dtxt, brks)
 pop.cdf.density(e, dcount, refcount, etxt, dtxt )

  pdf2(
  log10(bg$proximity.npl),
  bg$bin.EJ.DISPARITY.proximity.npl.eo, 10,
  main ='npl for high top 10 pct vs low EJ', xlab='NPL score log10'
  )
  
## End(Not run)

ejanalysis/analyze.stuff documentation built on April 2, 2024, 10:10 a.m.