RR.plot: Draw lineplot comparing RR values by group

View source: R/RR.plot.R

RR.plotR Documentation

Draw lineplot comparing RR values by group

Description

Draws a plot using relative risk information, one line per demographic group.

Usage

RR.plot(
  rrs,
  dnames,
  enames,
  zone = "USA",
  enames.nice,
  mycolors,
  type = "b",
  maxchar = 15,
  cex.axis = 0.5,
  cex.legend = 0.8,
  sorted = TRUE,
  margins = c(1, 2, 3),
  decreasing = TRUE,
  ...
)

Arguments

rrs

Table as from RR.table() function, of relative risk by demographic group, risk type, and zone (3 dimensions).

dnames

Demographic group names to be found as names of first dim of RRS. Optional, default is ejscreen::names.d.subgroups() and ejscreen::names.d() from the ejscreen dataset.

enames

Environmental factor or risk type names to be found as names of second dim of RRS. Optional, default is ejscreen::names.e() from ejscreen package.

zone

Zone name to be found among names for third dim of RRS. Default is "USA"

enames.nice

optional character vector of labels to use instead of enames on the plot, same length and order as enames

mycolors

optional vector of colors to use for the vector of dnames, default is from rainbow()

type

optional as in plot(), default is 'b' for both lines and points

maxchar

optional number, default 15. x axis labels are truncated to this length.

cex.axis

optional default 0.5, size of enames lables on x axis

cex.legend

optional default 0.8, size of dnames in legend

sorted

optional logical, default is TRUE. Whether to sort before plotting.

margins

optional numeric vector, default is c(1, 2, 3). Specifies which dimensions to sort if sorted is TRUE.

decreasing

optional logical, default is TRUE. How to sort if sorted is TRUE. All sorted dimensions get sorted the same way.

...

optional additional parameters to pass to plot()

Value

draws a line plot

See Also

RR.table()


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