RR.plotbar: Draw barplot comparing mean score in a group vs reference...

View source: R/RR.plotbar.R

RR.plotbarR Documentation

Draw barplot comparing mean score in a group vs reference group

Description

Draws a plot using group means from RR.means()

Usage

RR.plotbar(
  x,
  dname,
  ename,
  dlab = dname,
  elab = ename,
  reflab = paste("Non-", dlab, sep = ""),
  cex.names = 1.9,
  cex.axis = 1.5,
  ...
)

Arguments

x

Results of RR.means() function, mean indicator score or risk by demographic group

dname

Demographic group name to be found among names of first dim of x. Required.

ename

Environmental factor or risk type name to be found as names of second dim of x. Required.

dlab

optional character vector of label to use instead of dname on the plot. Default is dname.

elab

optional character vector of label to use instead of ename on the plot. Default is ename.

reflab

optional character vector of lable to use for reference group. Default is Non-dlab (e.g., "Non-Poor")

cex.names

optional numeric vector passed to barplot()

cex.axis

optional numeric vector passed to barplot()

...

optional other parameters passed to barplot()

Value

draws a barplot, returns the two values as named list

See Also

RR.plot()

Examples

## Not run: 
    data(bgtest, package = 'ejanalysis')
    ### x should be the output of RR.means()
    x <- RR.means(e = bgtest$traffic.score, d = bgtest$pctmin, pop = bgtest$pop)
    RR.plotbar(x, 'pctlths', 'proximity.rmp')
    RR.plotbar(x, 'pctmin', 'proximity.tsdf', dlab = 'Minorities',
      elab = 'Haz. Waste TSD Facility Proximity Score', ylab = 'Proximity Score')
 
## End(Not run)

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