netrankr v0.2.1


Monthly downloads



Analyzing Partial Rankings in Networks

Implements methods for centrality related analyses of networks. While the package includes the possibility to build more than 20 indices, its main focus lies on index-free assessment of centrality via partial rankings obtained by neighborhood-inclusion or positional dominance. These partial rankings can be analyzed with different methods, including probabilistic methods like computing expected node ranks and relative rank probabilities (how likely is it that a node is more central than another?). The methodology is described in depth in the vignettes and in Schoch (2018) <doi:10.1016/j.socnet.2017.12.003>.



CRAN Status Badge CRAN Downloads Travis-CI Build Status codecov


netrankr is an R package to analyze partial rankings in the context of networks centrality. While the package includes the possibility to build a variety of indices, its main focus lies on index-free assessment of centrality. Computed partial rankings can be analyzed with a variety of methods. These include probabilistic methods like computing expected node ranks and relative rank probabilities (how likely is it that a node is more central than another?).

Most implemented methods are very general and can be used whenever partial rankings have to be analysed.

Visit the online manual for more Details.


To install from CRAN:


To install the developer version from github:



Check out the online manual for more help.

The core functions of the package are:

  • Computing the neighborhood inclusion preorder with neighborhood_inclusion(). The resulting partial ranking is the foundation for any centrality related analysis on undirected and unweighted graphs. More details can be found in the dedicated vignette: vignette("neighborhood_inclusion",package="netrankr"). A generalizded version of neighborhood inclusion is implemented in positional_dominance(). See vignette("positional_dominance",package="netrankr") for help.

  • Constructing graphs with a unique centrality ranking with threshold_graph(). This class of graphs, known as threshold graphs, can be used to benchmark centrality indices, since they only allow for one ranking of the nodes. For more details consult the vignette: vignette("threshold_graph",package="netrankr").

  • Computing probabilistic centrality rankings. The package includes several function to calculate rank probabilities of nodes in a network, including expected ranks (how central do we expect a node to be?) and relative rank probabilities (how likely is it that a node is more central than another?). These probabilities can either be computed exactly for small networks (exact_rank_prob()), based on an almost uniform sample (mcmc_rank_prob()) or approximated via several heuristics (approx_rank_expected(),approx_rank_relative()). Consult vignette('probabilistic_cent',package='netrankr') for more information and vignette('benchmarks',package='netrankr') for applicability.

  • Although the focus of the package lies on an index-free assessement of centrality, the package provides the possibility to build a variety of indices. Consult vignette('centrality_indices',package='netrankr') for more information.

The package includes several additional vignettes, which can be viewed with browseVignettes(package = "netrankr") or online

Functions in netrankr

Name Description
hyperbolic_index Hyperbolic (centrality) index
comparable_pairs Comparable pairs in a partial ranking
neighborhood_inclusion Neighborhood-inclusion preorder
threshold_graph Random threshold graphs
spectral_gap Spectral gap of a graph
mcmc_rank_prob Estimate rank probabilities with Markov Chains
positional_dominance Generalized Dominance in Graphs
rank_intervals Rank interval of nodes
plot_rank_intervals Plot rank intervals
is_preserved Check preservation
majorization_gap Majorization gap
index_builder Centrality Index Builder
indirect_relations Indirect relations in a network
transform_relations Transform indirect relations
transitive_reduction Transitive Reduction
exact_rank_prob Probabilistic centrality rankings
florentine_m Florentine family marriage network
approx_rank_relative Approximation of relative rank probabilities
compare_ranks Count occurrences of pairs in rankings
get_rankings Rankings that extend a partial ranking
netrankr netrankr: An R package for centrality and partial rankings in networks
aggregate_positions Quantification of (indirect) relations
dominance_graph Partial ranking as directed graph
approx_rank_expected Approximation of expected ranks
No Results!

Vignettes of netrankr

No Results!

Last month downloads


Type Package
License MIT + file LICENSE
Encoding UTF-8
LazyData true
LinkingTo Rcpp,RcppArmadillo
SystemRequirements C++11
RoxygenNote 6.0.1
VignetteBuilder knitr
NeedsCompilation yes
Packaged 2018-09-17 18:49:34 UTC; david
Repository CRAN
Date/Publication 2018-09-18 08:20:03 UTC

Include our badge in your README