socialgraph: Visualize a social network

Description Usage Arguments Details Examples

Description

Function for plotting social networks with options to size nodes based on centrality values and/or edge widths sized based on edge widths. (NOTE: centrality values are based on an unweighted network)

Usage

1
social_graph(edgelist, sizeby = "none", weighted = FALSE)

Arguments

edgelist

a dataframe that contains a list of people and their associates. The first column represents source nodes and the second column represents target nodes.

sizeby

custom option to size nodes based on either "degree", "eigenvector", "betweenness", or "closeness" centrality. Default to "none".

weighted

custom option to size edges based on weighted values. Default to "FALSE".

Details

Degree centrality identifies well-connected nodes. Eigenvector centrality identifies nodes that are connected to well-connected nodes. Betweenness centrality identifies nodes that serve as bridges. Closeness centrality identifies nodes that are close to all other nodes in a network.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# minimal example
source <- c("a", "a", "b", "c", "d", "d", "d")
target <- c("b", "c", "c", "d", "e", "f", "g")
associations <- data.frame(source, target)
social_graph(edgelist = associations, sizeby = "betweenness")

# FM 3-24 example affiliation matrix
data("fm3_24_affiliation")
affiliations <- as.data.frame(fm3_24_affiliation)
associations <- transform2social(edgelist = affiliations)
social_graph(edgelist = associations, sizeby = "betweenness", weighted = TRUE)

dkoban/SNAToolKit documentation built on May 20, 2019, 1:28 p.m.