rankRankPlot | R Documentation |
Generate rank-rank plots for ranking comparison.
rankRankPlot(object, id.col = FALSE, p.size = 1.5, p.nudge = 0.05,
s.width = 0.5, lab.size = 3.88,
max.overlaps = 10, max.tick = 50,
ref.lab = "Reference ranking", alt.lab = "Alternative ranking",
y.lab = NULL, combine = FALSE, nr = NULL, nc = NULL)
object |
an object of class |
id.col |
a logical value indicating whether the rank-rank segment should be colored by unit identifiers. It is not recommended if having more than 20 units. |
p.size |
size of segment endpoints. |
p.nudge |
horizontal adjustment value to nudge the starting position of labels. |
s.width |
line width for rank-rank segments. |
lab.size |
label size value. |
max.overlaps |
a value to exclude the label if it has too many overlaps.
The default value is |
max.tick |
a positive integer to control the maximum number of axis
ticks. The default value is |
ref.lab |
name of the reference index. |
alt.lab |
name of the alternative index. |
y.lab |
label of the y-axis. |
combine |
a logical value indicating whether to generate a grid that
combines plots from different time factors (If |
nr |
(optional) number of rows in the plot grid. |
nc |
(optional) number of columns in the plot grid. |
A plot comparing two rankings connected by segments. In case object$time
is not NULL
, a list of plots for different time factors and the combined
grid (if combine = TRUE
) will be returned. The function does not print the
return if it is assigned to an object. Use print
with the storing object
to generate the plot.
Viet Duong Nguyen, Chiara Gigliarano, Mariateresa Ciommi
rankComp
, rankScatterPlot
, rankShiftPlot
.
data(bli)
# Goalpost normalization
bli.pol = c("neg", "pos", "pos", "pos", "pos", "neg",
"pos", "pos", "pos", "neg", "pos")
bli.norm.2014 <- normalize(inds = bli[, 3:13], method = "goalpost",
ind.pol = bli.pol, time = bli$YEAR,
ref.time = 2014)
# Composite indices
ci.gini <- giniCI(bli.norm.2014, method = "gini",
ci.pol = "pos", time = bli$YEAR, ref.time = 2014,
only.ci = TRUE)
ci.reci <- giniCI(bli.norm.2014, method = "reci", agg = "geo",
ci.pol = "pos", time = bli$YEAR, ref.time = 2014,
only.ci = TRUE)
# Ranking comparison plots
ci.comp <- rankComp(ci.gini, ci.reci, id = bli$COUNTRY, time = bli$YEAR)
rankScatterPlot(ci.comp)$'2014'
rankShiftPlot(ci.comp)$'2015'
rankRankPlot(ci.comp)$'2016'
# Storing and printing
p.scatter <- rankScatterPlot(ci.comp, combine = TRUE, max.overlaps = 20)
print(p.scatter$'2017') # or: print(p.scatter[[4]])
print(p.scatter$'comb') # or: print(p.scatter[[5]])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.