transform2social: Convert an affiliation network to an association network

Description Usage Arguments Examples

View source: R/transform2social.R

Description

Function for transforming an edgelist consisting of affiliaiton data to an edgelist containing association data. The resulting edgelist generates edge weights that correspond to the number of shared activities

Usage

1
transform2social(edgelist)

Arguments

edgelist

a dataframe that contains a list of people and their associated activities. The first column should list the name of the source node; the second column should list associated activities.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# minimal example
agents <-  c("Bill", "Bill", "Bill", "Bob", "Bob", "Bob", "John", "John")
activities <- c("Act1","Act2", "Act3","Act1", "Act2","Act4","Act3","Act4")
affiliations <- data.frame(agents, activities)
transform2social(edgelist = affiliations)

# FM 3-24 example affiliation matrix
data("fm3_24_affiliation")
affiliations <- as.data.frame(fm3_24_affiliation)
transform2social(edgelist = affiliations)

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