View source: R/RR.table.sort.R
RR.table.sort | R Documentation |
Sort table of Relative Risk results by zone by group by envt risk factor
RR.table.sort(x, margins = c(1, 2, 3), decreasing = TRUE)
x |
Array of RR values from |
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) |
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)
RR()
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']
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.