Description Usage Arguments Details Value Author(s) References See Also Examples
View source: R/buildFamilyNetwork_Ind.R
This function produces an individual-level family network following the rules of name inheritance used in the Philippines. These rules were employed by Cruz, Labonne, and Querubin (2016) to construct family-level networks (where family names are the nodes; see the function buildFamilyNetwork_Fam to replicate their work).
1 | buildFamilyNetwork_Ind(data, ID, lastName, middleName, area = NULL, graph = TRUE, metadata = TRUE)
|
data |
A data frame with individuals on the rows and attributes on the columns. One row per individual. |
ID |
A character string corresponding to the name of a unique identifier for individuals in data. Numeric identifiers work best. Default is NULL. If NULL, unique IDs generated. |
lastName |
Character string corresponding to the column in data of last names. |
middleName |
Character string corresponding to the name of the vector of middle names in data. |
area |
Character string corresponding to the name of a vector in data that distinguishes an area within which network ties should be drawn. Vector is coerced to factor. Default is NULL. |
graph |
Logical. Should an igraph object be produced. If false, a edge list is returned. Default is TRUE. |
metadata |
Logical. Should other variables in data be included in the igraph object as attributes. Default is TRUE unless graph equals FALSE. |
This function constructs family networks, with individual people serving as nodes in the network, following the naming convention first exploited by Cruz, Labonne, and Querubin (2016). See their paper for details on the inheritance rules that make this possible. See Davidson, Hicken and Ravanilla (2016) for an example of this individual-level network.
Either an igraph object or edge list with two columns containing ego and alter ids.
Michael Davidson mwdavidson@ucsd.edu
Cruz, C., Labonne, J. & Querubin, P. 2016. Politician Family Networks and Electoral Outcomes.
Davidson, M., Hicken, H., & Ravanilla, Nico. 2016. Family Networks and Voting Behavior: Evidence from the Philippines.
buildFamilyNetwork_Fam
,
buildFamilyNetwork_Community
1 2 3 4 5 6 7 8 9 10 11 | # Load sample data
data(CARASI)
# Build the network producing an Igraph object with meta data
buildFamilyNetwork_Ind(data = CARASI, ID = "ID", lastName = "lastName", middleName = "middleName", area = "BARANGAY", graph = TRUE, metadata = TRUE)
# Build the network producing an Igraph object without meta data
buildFamilyNetwork_Ind(data = CARASI, ID = "ID", lastName = "lastName", middleName = "middleName", area = "BARANGAY", graph = TRUE, metadata = FALSE)
# Build the network producing an edge list
buildFamilyNetwork_Ind(data = CARASI, ID = "ID", lastName = "lastName", middleName = "middleName", area = "BARANGAY", graph = FALSE, metadata = FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.