plot.rank_stability {parsec} | R Documentation |
Plot outputs of PARSEC function rank_stability.
Description
The function generates four plots, to reproduce the sequence of the average ranks and of the positions of the elements, in the rankings associated to the alpha-cut posets.
Rankings and average ranks have to be evaluted with the function rank_stability
.
First and third plots show the sequence of average ranks, second and fourth show the sequence of rankings. Sequences in first and second plots are shown against the sequence of alpha-cuts, in third and fourth plots as a function of alpha values.
Usage
## S3 method for class 'rank_stability'
plot(x,
which = 1:4, legend = TRUE, legend.x = "bottomleft",
legend.y = NULL, legend.bg = "white", grid = TRUE,
grid.lty = 2, grid.col = rgb(0, 0, 0, 1/7),
grid.lwd = 1, y_axis = "reversed", ask = dev.interactive(),
type = "l", col = gray(1:ncol(x$ranking)/ncol(x$ranking)/1.3),
lwd = 3, lty = 1, ...
)
Arguments
x |
object of class |
which |
select a subset of the numbers 1:4, to specify the desired plots. See caption below (and the 'Details'). |
legend |
boolean argument to choose whether to show the legend in the plots. |
legend.x , legend.y , legend.bg |
arguments |
grid |
boolean argument to choose whether to show the grid in the plots. |
grid.lty , grid.col , grid.lwd |
arguments defining the line type, color and width of the grid. |
y_axis |
if it is set equal to "reversed" plots show the y axis reversed. |
ask |
boolean argument indicating whether the system has to ask users before changing plots. |
type |
1-character string giving the desired type of plot. See |
col |
vector of colors. See |
lwd |
vector of line widths. See |
lty |
vector of line types. See |
... |
other arguments of function |
See Also
rank_stability
, legend
, plot.default
, matplot
Examples
v1 <- as.ordered(c("a", "b", "c", "d"))
v2 <- 1:3
prof <- var2prof(varmod = list(v1 = as.ordered(c("a", "b", "c", "d")), v2 = 1:3))
np <- nrow(prof$profiles)
k <- 10 # number of populations
set.seed(0)
populations <- as.data.frame(lapply(1:k, function(x) round(runif(np)*100)))
rownames(populations) <- rownames(prof$profiles)
names(populations) <- paste0("P", 1:k)
x <- FFOD(profiles = prof, distributions = populations)
res <- rank_stability(x)
plot(res)