RankTable {RankingProject} | R Documentation |
Figure containing a table of ranking data.
Description
RankTable
creates a figure with a table of ranking data.
This may not look very good plotted on its own.
Rather, it is meant for use within RankPlotWithTable
,
which draws this table aligned with a plot of the data
in one combined figure.
Usage
RankTable(
ranks,
names,
est,
se,
placeType = "State",
col1 = 0.15,
col2 = 0.6,
col3 = 0.85,
col4 = 1,
textPos = 2,
titleCex = 0.9,
titleLift = 1.5,
contentCex = 0.7,
columnsPlotRefLine = NULL,
tikzText = FALSE
)
Arguments
ranks |
Vector containing the rank of each area. |
names |
Vector containing the name of each area. |
est , se |
Vectors containing the point estimate and its standard error
for each area.
See vignettes for examples of using |
placeType |
String, naming the type of places or units being ranked. |
col1 , col2 , col3 , col4 |
Numeric values between 0 and 1,
showing where each column's right-hand-side endpoint is
along the table's width. In other words, |
textPos |
Passed to |
titleCex |
Character expansion factor for column titles. |
titleLift |
Numeric value for how many row-heights to raise column titles above top row of column contents. |
contentCex |
Character expansion factor for column contents (all column text except the titles). |
columnsPlotRefLine |
Optional numeric value. If not NULL, how many row-heights below bottom row of column contents to print the phrase "Reference State:" (or "Reference <placeType>:") as a label for bottom row of columns plot. |
tikzText |
Logical, for whether or not to format text for tikz plotting. |
Details
This function is currently hardcoded to give a table with four columns,
with given column names. Users may wish to modify this code and write
their own table function, which can be swapped into tableFunction
within RankPlotWithTable
. Be aware that
RankPlotWithTable
uses layout
to arrange
the table and plot side-by-side, so layout
cannot be used within
a new tableFunction
.
See Also
RankPlotWithTable
and RankPlot
.
Examples
# Table of US states' mean travel times to work, from the 2011 ACS
data(TravelTime2011)
# Just as inside RankPlotWithTable(),
# we have to set par(xpd=TRUE)
# and adjust the plotting margins
oldpar <- par(no.readonly = TRUE)
oldmar <- par('mar')
par(xpd=TRUE, mar=c(oldmar[1],0,oldmar[3],0))
with(TravelTime2011,
RankTable(ranks = Rank, names = State,
est = Estimate.2dec, se = SE.2dec,
placeType = "State"))
par(oldpar)