1% Generated by roxygen2: do not edit by hand
2% Please edit documentation in R/get_betweenness.R
3\name{get_betweenness}
4\alias{get_betweenness}
5\title{Get betweenness centrality scores}
6\usage{
7get_betweenness(graph)
8}
9\arguments{
10\item{graph}{A graph object of class \code{dgr_graph}.}
11}
12\value{
13a data frame with betweenness scores for each of the nodes.
14}
15\description{
16Get the betweenness centrality scores for all nodes in a graph.
17}
18\examples{
19# Create a random graph using the
20# `add_gnm_graph()` function
21graph <-
22  create_graph() \%>\%
23  add_gnm_graph(
24    n = 10,
25    m = 12,
26    set_seed = 23)
27
28# Get the betweenness scores
29# for nodes in the graph
30graph \%>\% get_betweenness()
31
32# Add the betweenness
33# values to the graph
34# as a node attribute
35graph <-
36  graph \%>\%
37  join_node_attrs(
38    df = get_betweenness(.))
39
40# Display the graph's node
41# data frame
42graph \%>\% get_node_df()
43
44}
45