View source: R/get_network_data.R
get_network_data | R Documentation |
network_data
returns a dataframe of the state networks data compiled
by the Correlates of State Policy Project. The dataframe is in an edge list
format, with each row a state dyad combination. The merge
argument
allows the direct merging of a dataframe generated by the
get_cspp_data
function.
get_network_data(category = NULL, merge_data = NULL)
category |
A category within the networks data. Default is NULL. If left blank, returns the full state networks data. Category options are "Distance Travel Migration", "Economic", "Political", "Policy", "Demographic". |
merge_data |
Default is NULL. Takes a dataframe object in the format
generated by |
The network dataframe that results is directed, with variables directed
towards the state in the State1
column. For instance, the
IncomingFlights
variable is the number of flights from State2
with a destination in State1
.
A dataframe formatted as an edge list.
For more information on the construction of the network data as well as a full codebook see http://ippsr.msu.edu/public-policy/state-networks.
# Load full network data: network.df <- get_network_data() # Network data for subset of categories: network.df <- get_network_data(category = c("Economic", "Political")) # Merge in data from get_cspp_data() network.df <- get_network_data(category = "Distance Travel Migration", merge_data = get_cspp_data(vars = c("sess_length", "hou_majority"), years = seq(1999, 2000)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.