targbetween_alldyads: Targeted Betweenness Centrality for Specified Source and...

Description Usage Arguments Value Examples

View source: R/targbetween.R

Description

This function computes targeted betweenness centrality for one or more sources and one or more destinations. The set of dyads to be evaluated includes all possible pairs of source vertices and destination vertices from the specified source and destination vectors.

Usage

1
2
3
4
5
6
7
8
targbetween_alldyads(
  network,
  source,
  destination,
  filename = NULL,
  directed = FALSE,
  update = 0
)

Arguments

network

An igraph network graph

source

A vector of one or more vertices in network

destination

A vector of one or more vertices in network

filename

A character value indicating the file location to output results (default = NULL)

directed

A boolean value indicating whether the network should be treated as directed (default = FALSE)

update

A numeric value indicating how many loop iterations should elapse between progress updates (default = 0, which suppresses output)

Value

A data.frame with the results for targeted betweenness centrality

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
my_network <- igraph::erdos.renyi.game(20, 0.5, directed = FALSE)
single_source <- igraph::V(my_network)[1]
single_destination <- igraph::V(my_network)[20]
multiple_sources <- igraph::V(my_network)[1:5]
multiple_destinations <- igraph::V(my_network)[6:10]
results1 <- targbetween_alldyads(my_network, single_source,
  single_destination)
results2 <- targbetween_alldyads(my_network, single_source,
  multiple_destinations, directed=FALSE)
results3 <- targbetween_alldyads(my_network, multiple_sources,
  single_destination, directed=TRUE)
results4 <- targbetween_alldyads(my_network, multiple_sources,
  multiple_destinations, directed=FALSE, update=1000)
results4
#       vertices targeted_betweenness
#  [1,] "1"      "0.533333333333333" 
#  [2,] "2"      "0.866666666666667" 
#  [3,] "3"      "0.5"               
#  [4,] "4"      "0.291666666666667" 
#  [5,] "5"      "1.11666666666667"  
#  [6,] "6"      "1.86666666666667"  
#  [7,] "7"      "0.541666666666667" 
#  [8,] "8"      "0.291666666666667" 
#  [9,] "9"      "0"                 
# [10,] "10"     "1.36666666666667"  
# [11,] "11"     "0.991666666666667" 
# [12,] "12"     "2.03333333333333"  
# [13,] "13"     "0.366666666666667" 
# [14,] "14"     "0.458333333333333" 
# [15,] "15"     "1.15833333333333"  
# [16,] "16"     "0.75"              
# [17,] "17"     "0"                 
# [18,] "18"     "1.20833333333333"  
# [19,] "19"     "0.866666666666667" 
# [20,] "20"     "0.791666666666667" 

bcbritt/targbetween documentation built on April 21, 2021, 6:12 p.m.