RankPlotWithTable {RankingProject} | R Documentation |
Figure containing aligned table and plot of ranking data.
Description
RankPlotWithTable
aligns a table of ranking data with a plot of the
data, in one combined figure. See RankTable
and
RankPlot
for details about the default table and plot
functions, including arguments that can be passed to those functions.
Usage
RankPlotWithTable(
tableParList,
plotParList,
tableFunction = RankTable,
plotFunction = RankPlot,
tableWidthProp = 3/8,
tikzText = FALSE,
annotRefName = NULL,
annotRefRank = NULL,
annotX = 0
)
Arguments
tableParList |
A required named list of arguments that will be passed
to |
plotParList |
A required named list of arguments that will be passed
to |
tableFunction |
The function to use for plotting a table of the data
on the left-hand side of the layout. Default is |
plotFunction |
The function to use for plotting a figure of the data
on the right-hand side of the layout. Default is |
tableWidthProp |
A number between 0 and 1, for what proportion of the
layout's width should be used to plot the table. The remaining proportion
|
tikzText |
Logical, formats text for tikz plotting if |
annotRefName , annotRefRank |
Optional rank and name of the reference
area, for adding an extra
annotation below the figure created by |
annotX |
A number, showing where on the x-axis to center the annotation
if |
Details
Users may write their own table and plot functions to swap into
tableFunction
and plotFunction
. Be aware that
RankPlotWithTable
uses layout
to arrange
the table and plot side-by-side, so layout
cannot be used within
either tableFunction
or plotFunction
. This can also cause
trouble for using the lattice
package within plotFunction
.
See Also
Examples
# Table with plot of individual 90% confidence intervals
# for US states' mean travel times to work, from the 2011 ACS
data(TravelTime2011)
tableParList <- with(TravelTime2011,
list(ranks = Rank, names = State,
est = Estimate.2dec, se = SE.2dec,
placeType = "State"))
plotParList <- with(TravelTime2011,
list(est = Estimate.2dec, se = SE.2dec,
names = Abbreviation,
confLevel = .90, plotType = "individual", cex = 0.6))
RankPlotWithTable(tableParList = tableParList,
plotParList = plotParList)
# Illustrating the use of annotRefName and annotRefRank:
# Table with plot of 90% confidence intervals for differences
# between each state and Colorado, with demi-Bonferroni correction
plotParList$plotType <- "difference"
plotParList$refName <- "CO"
RankPlotWithTable(tableParList = tableParList,
plotParList = plotParList, annotRefName = "Colorado",
annotRefRank = TravelTime2011$Rank[which(TravelTime2011$Abbreviation == "CO")])