Learn R Programming

parsec (version 1.2.7)

plot.rank_stability: 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 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 rank_stability generated by function rank_stability.

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 x, y and bg of the function legend defining the coordinates and the backgroud color of the legend.

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 plot.default for details.

col

vector of colors. See matplot for details.

lwd

vector of line widths. See matplot for details.

lty

vector of line types. See matplot for details.

...

other arguments of function matplot.

See Also

rank_stability, legend, plot.default, matplot

Examples

Run this code
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)

Run the code above in your browser using DataLab