Get Discordant Edgelist Based on Specified Status Variable
Source:R/edgelists.R
get_discordant_edgelist.RdThis function returns a data.frame with a discordant
edgelist, defined as the set of edges for which the status attribute
of interest is discordant between the two partners.
Arguments
- dat
Main
netsim_datobject containing anetworkDynamicobject and other initialization information passed fromnetsim().- status.attr
The name of the status attribute of interest.
- head.status
The value(s) of
status.attrfor which to look for the head of the edge. Can be a single value or a vector.- tail.status
The value(s) of
status.attrfor which to look for the tail of the edge. Can be a single value or a vector.- networks
Numerical indexes of the networks to extract the partnerships from. (May be > 1 for models with multiple overlapping networks.) If
NULL, extract from all networks.
Value
A data.frame with the following columns:
head: Positional ID of the head node.tail: Positional ID of the tail node.head_status: Status of the head node.tail_status: Status of the tail node.network: The numerical index of the network on which the partnership is located.
Details
This is a generalized version of the discord_edgelist function.
It creates an edgelist of current partnerships in which the status attribute
of interest (as specified by the parameter status.attr) of one partner matches
the value (or one of the values) of the head.status parameter while the
corresponding status attribute of the other partner matches the value (or
one of the values) of the tail.status parameter.