is_preserved: Check preservation

Description Usage Arguments Details Value Author(s) Examples

View source: R/check.preservation.R

Description

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

Usage

1
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

1
2
3
4
5
6
7
8
library(igraph)
# standard measures of centrality preserve the neighborhood inclusion preorder
data("dbces11")
P <- neighborhood_inclusion(dbces11)

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

netrankr documentation built on Sept. 5, 2021, 5:19 p.m.