Learn R Programming

parsec (version 1.2.0)

plot.rank_stability: Plot outouts of PARSEC function rank_stability

Description

The function generates four plots to analyse the evolution of the average ranks and positions in the ranking of the profiles associated to the selected posets generated by different alpha-cuts in the posetic FOD analysis.

Rankings and average ranks have to be evaluted with the function rank_stability.

First and third plots show the evolution of average ranks, second and fourth show the evolution of rankings. Evolutions in first and second plots are shown as progressions in a sequence of posets, in third and fourth plots evolutions are compared with the alpha values that generate the posets.

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 the function rank_stability.

which

if a subset of the plots is required, specify a subset of the numbers 1:4, see caption below (and the 'Details') for the different kinds.

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 to define the co-ordinates 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 to define 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 before changing the plot.

type

1-character string giving the type of plot desired. See plot.default for details.

col

vector of colors. Colors are used cyclically. See matplot for details.

lwd

vector of line widths. Widths are used cyclically. See matplot for details.

lty

vector of line types. Types are used cyclically. See matplot for details.

other arguments of the function matplot.

See Also

rank_stability, legend, plot.default, matplot

Examples

Run this code
# NOT RUN {
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