RR.table.sort: Sort table of Relative Risk results by zone by group by envt...

View source: R/RR.table.sort.R

RR.table.sortR Documentation

Sort table of Relative Risk results by zone by group by envt risk factor

Description

Sort table of Relative Risk results by zone by group by envt risk factor

Usage

RR.table.sort(x, margins = c(1, 2, 3), decreasing = TRUE)

Arguments

x

Array of RR values from RR() in array of 3 dimensions: xDnames, Enames, Zcolnames

margins

optional numeric vector of which dimensions to sort, default is all 3, so margins = c(1, 2, 3) by default

decreasing

default is TRUE, defines how to sort (note all specified dimensions are sorted the same way by this function)

Value

Sorted version of x array of 3 dimensions: RRSDnames, Enames, Zcolnames Returns an array with one demographic group per row, one environmental risk indicator per column, and third dimension for which zone (e.g., which US State)

See Also

RR()

Examples

RRS.US  <- RR.table(mydat=bg, Enames=names.e, Dnames=c(names.d, names.d.subgroups.pct),
 popcolname='pop')
RRS.ST  <- RR.table(mydat=bg, Enames=names.e, Dnames=c(names.d, names.d.subgroups.pct),
 popcolname='pop', Zcolname='ST')
RRS <- RR.table.add(RRS.ST, RRS.US)
RRS[ 'pctlowinc', , ]
RRS[ , , 'CA']
RRS[ , 'pm', ]

RR.plot(RR.table.sort(RRS))
RR.table.sort(RRS, 1)

RRS.REGION  <- RR.table(mydat=bg, Enames=names.e, Dnames=c(names.d, names.d.subgroups.pct),
 popcolname='pop', Zcolname='REGION')
RRS2 <- RR.table.add(RRS, RRS.REGION)
RRS2[ , , '8']

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