Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

is_preserved

Check preservation


Description

Checks if a partial ranking is preserved in the ranking induced by scores.

Usage

is_preserved(P, scores)

Arguments

P

A partial ranking as matrix object calculated with neighborhood_inclusion or positional_dominance.

scores

Numeric vector containing the scores of a centrality index.

Details

In order for a score vector to preserve a partial ranking, the following condition must be fulfilled: P[u,v]==1 & scores[i]<=scores[j].

Value

Logical scaler whether scores preserves the relations in P.

Author(s)

David Schoch

Examples

library(igraph)
# standard measures of centrality preserve the neighborhood inclusion preorder
g <- graph.empty(n=11,directed = FALSE)
g <- add_edges(g,c(1,11,2,4,3,5,3,11,4,8,5,9,5,11,6,7,6,8,
                   6,10,6,11,7,9,7,10,7,11,8,9,8,10,9,10))
P<-neighborhood_inclusion(g)

is_preserved(P,degree(g))
is_preserved(P,betweenness(g))
is_preserved(P,closeness(g))

netrankr

Analyzing Partial Rankings in Networks

v0.3.0
MIT + file LICENSE
Authors
David Schoch [aut, cre], Julian Müller [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.