View source: R/incidence.from.congress.R
incidence.from.congress | R Documentation |
incidence.from.congress()
uses data from https://www.congress.gov/ to construct an incidence
matrix or bipartite graph recording legislators' bill (co-)sponsorships.
incidence.from.congress( session = NULL, types = NULL, areas = "all", nonvoting = FALSE, weighted = FALSE, format = "data", narrative = FALSE )
session |
numeric: the session of congress |
types |
vector: types of bills to include. May be any combination of c("s", "sres", "sjres", "sconres") OR any combination of c("hr", "hres", "hjres", "hconres"). |
areas |
string: policy areas of bills to include (see details) |
nonvoting |
boolean: should non-voting members be included |
weighted |
boolean: should sponsor-bill edges have a weight of 2, but cosponsor-bill edges have a weight of 1 |
format |
string: format of output, one of c("data", "igraph") |
narrative |
boolean: TRUE if suggested text & citations should be displayed. |
The incidence.from.congress()
function uses data from https://www.congress.gov/ to
construct an incidence matrix or bipartite graph recording legislators' bill (co-)sponsorships. In an incidence matrix
I, entry Iik = 1 if legislator i sponsored or co-sponsored bill k, and otherwise is 0. In a bipartite graph
G, a legislator i is connected to a bill k if i sponsored or co-sponsored k.
In the US Congress, the law making process begins when a sponsor legislator introduces a bill in their chamber (House of Representatives or Senate). Additional legislators in the same chamber can support the bill by joining as a co-sponsor. The bill is discussed, revised, and possibly voted on in the chamber. If it passes in one chamber, it is sent to the other chamber for further discussion, revision, and possibly a vote. If it passed both chambers, it is sent to the President. If the President signs the bill, it becomes law.
In the House of Representatives, legislators can introduce four types of bills: a House Bill (hr), a House Joint Resolution (hjres), a House Concurrent Resolution (hconres), and a House Simple Resolution (hres). Similarly, in the Senate, legislators can introduce four types of bills: a Senate Bill (s), a Senate Joint Resolution (sjres), a Senate Concurrent Resolution (sconres), and a Senate Simple Resolution (sres). In both chambers, concurrent and simple resolutions are used for minor procedural matters and do not have the force of law. Only bills and joint resolutions require the President's signature and have the force of law if signed.
Each bill is assigned a policy area by the Congressional Research Service. By default, bills from all policy areas are included,
however the areas
parameter can be used to include only bills addressing certain policy areas. The areas
takes a vector of
strings listing the desired policy areas (e.g., areas = c("Congress", "Animals")
). A complete list of policy areas and brief
descriptions is available at https://www.congress.gov/help/field-values/policy-area.
If format = "data"
, a list containing an incidence matrix, a dataframe of legislator characteristics, and a dataframe of bill characteristics.
If format = "igraph"
, a bipartite igraph object composed of legislator vertices and bill vertices, each with vertex attributes.
For both formats, legislator characteristics include: BioGuide ID, full name, last name, party affiliation, and state. Bill characteristics include: bill ID, introduction date, title, policy area, status, sponsor's party, and number of co-sponsors from each party.
Tutorial: Neal, Z. P. 2022. Constructing legislative networks in R using incidentally and backbone. Connections, 42. doi: 10.2478/connections-2019.026
Package: Neal, Z. P. 2022. incidentally: An R package to generate incidence matrices and bipartite graphs. OSF Preprints doi: 10.31219/osf.io/ectms
## Not run: D <- incidence.from.congress(session = 116, types = "s", format = "data") D <- incidence.from.congress(session = 116, types = "s", format = "data", areas = "animals") G <- incidence.from.congress(session = 115, types = c("hr", "hres"), format = "igraph") ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.