buildnet | R Documentation |
Transform weighted social network data collected in wide format to a network graph (igraph object), matrix, or edgelist.
buildnet( snawide, nettype, weighttype = "Strength", missingweight = 1, return = "graph" )
snawide |
Wide social network dataframe to be transformed |
nettype |
Character string; name of network, matching column names, in quotes (e.g., "Friend") |
weighttype |
Character string; tie strength type in variable names, in quotes (default is "Strength") |
missingweight |
Numeric; if participant nominated a tie but did not provide a tie strength rating, what strength should be assumed? (default is 1) |
return |
Character string; if "graph" or "network" (default), function will return an igraph graph object; if "matrix," function will return a network matrix; if "edgelist" or "el," function will return an edgelist |
Requires set naming system: participant id column named "PPID", nominated tie columns named network type + tie number + "Name" or "ID" (e.g., "Friend1Name" or "Friend1ID"), tie strength columns named network type + tie number + tie strength type (e.g., "Friend1Strength"). Isolates are retained by including a self-nomination (loop) with tie weight 0.
A weighted igraph graph, network matrix, or edgelist
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.