
Generate rank scatter plots for ranking comparison.
rankScatterPlot(object, p.col = "black", p.size = 1.5, p.shape = 19,
lab = TRUE, lab.col = "red", lab.size = 3.88,
ref.line = TRUE, max.overlaps = 10, max.tick = 50,
ref.lab = "Reference ranking", alt.lab = "Alternative ranking",
combine = FALSE, nr = NULL, nc = NULL)
A scatter plot displaying unit rankings for two indices. 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.
an object of class "rankComp"
, usually, an output of a call
to rankComp
.
point color code. See ‘Color Specification’
in par
.
point size value.
point shape value. See ‘pch values’ in points
.
a logical value indicating whether identifier labels should be
assigned to scatter points. If object$id
is NULL
, the points
will be labeled by the row index.
color code for labels. See ‘Color Specification’ in
par
.
label size value.
a logical value indicating whether a 45-degree reference line should be added to the plot.
a value to exclude the label if it has too many overlaps.
The default value is 10
. Set max.overlaps = Inf
to always show all
labels.
a positive integer to control the maximum number of axis
ticks. The default value is 50
. Set max.tick
equal to or greater than
the number of rankings to display all rankings on the axis.
name of the reference index.
name of the alternative index.
a logical value indicating whether to generate a grid that
combines plots from different time factors (If object$time
is not NULL
).
(optional) number of rows in the plot grid.
(optional) number of columns in the plot grid.
Viet Duong Nguyen, Chiara Gigliarano, Mariateresa Ciommi
rankComp
, rankShiftPlot
, rankRankPlot
.
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]])
Run the code above in your browser using DataLab