This function creates a rank plot.
rankPlot(
df,
title = NULL,
summarize = TRUE,
viridisPal = "turbo",
xLab = "Item",
yLab = "Rank count",
legendTitle = "Rank",
sigDigits = NULL,
labelSize = 2.5,
labelColor = "black",
labelFace = c("plain", "bold", "italic", "bold-italic"),
legendTextSize = 10,
legendTitleSize = 10,
axisTextSize = 12,
axisTitleSize = 12,
xAngle = 45,
vJust = 0.6,
labelScalingFactor = 0.9,
labelOffset = 0.05,
...
)An object of class gg.
A data frame with ranks as columns and items as rows, or a
summary data frame generated with rankSummary. If the latter,
summarize must be set to FALSE.
Plot title.
Whether to summarize the ranks with rankSummary.
Must be set to FALSE if the input data frame has been generated with
rankSummary.
Viridis palette.
Label of x axis.
y axis label.
Legend title.
Number of significant digits used when displaying mean
ranks. If NULL, the mean ranks will not be displayed.
Size of label marking average rank for each item.
Ignored if sigDigits is NULL.
Color of label marking average rank for each item.
Ignored if sigDigits is NULL.
Font face of label marking average rank for each item. Must
be one among 'plain', 'bold', 'italic' and 'bold-italic'.
Ignored if sigDigits is NULL.
Legend text size.
Legend title size.
Axis text size.
Axis title size.
Angle of x axis text.
Vertical justification in [0, 1].
Scaling factor used when displaying mean ranks.
Ignored if sigDigits is NULL.
Vertical offset used when displaying mean ranks.
Ignored if sigDigits is NULL.
Additional arguments passed to centerTitle.
df <- do.call(cbind, lapply(seq(30), function(i) sample(10, 10)))
rownames(df) <- paste0('M', seq(10))
colnames(df) <- paste0('R', seq(30))
rankPlot(df)
Run the code above in your browser using DataLab