1% Generated by roxygen2: do not edit by hand
2% Please edit documentation in R/get_leverage_centrality.R
3\name{get_leverage_centrality}
4\alias{get_leverage_centrality}
5\title{Get leverage centrality}
6\usage{
7get_leverage_centrality(graph)
8}
9\arguments{
10\item{graph}{A graph object of class \code{dgr_graph}.}
11}
12\value{
13A data frame with leverage centrality values for each of the nodes.
14}
15\description{
16Get the leverage centrality values for all nodes in the graph. Leverage
17centrality is a measure of the relationship between the degree of a given
18node and the degree of each of its neighbors, averaged over all neighbors. A
19node with negative leverage centrality is influenced by its neighbors, as the
20neighbors connect and interact with far more nodes. A node with positive
21leverage centrality influences its neighbors since the neighbors tend to have
22far fewer connections.
23}
24\examples{
25# Create a random graph using the
26# `add_gnm_graph()` function
27graph <-
28  create_graph(
29    directed = FALSE) \%>\%
30  add_gnm_graph(
31    n = 10,
32    m = 15,
33    set_seed = 23)
34
35# Get leverage centrality values
36# for all nodes in the graph
37graph \%>\%
38  get_leverage_centrality()
39
40# Add the leverage centrality
41# values to the graph as a
42# node attribute
43graph <-
44  graph \%>\%
45  join_node_attrs(
46    df = get_leverage_centrality(.))
47
48# Display the graph's node data frame
49graph \%>\% get_node_df()
50
51}
52