Learn R Programming

Ecfun (version 0.1-4)

UShouse.senate: Create a list of members of the US House and Senate

Description

Combine the output of readUShouse and readUSsenate.

Usage

UShouse.senate(house=readUShouse(), senate=readUSsenate())

Arguments

house, senate
data.frames as returned by the functions readUShouse and readUSsenate, respectively.

Value

  • a data.frame with the following columns:
  • OfficeA factor identifying "House" vs. "Senate", indicating whether the person is in the US House or Senate
  • stateA factor identifying the state using the USPS 2-letter state code (all caps)
  • district"0" or "At-Large" for members of the US House representing an entire state or integers in character format indicating the district. For the Senate, this contains the "class", which codes the year of the next election for that seat is an integer multiple of 6 years after 2012, 2008, or 2010 for class "1", "2", or "3", respectively.
  • Partya factor identifying the party affiliation of each representative, e.g., 'Democratic', 'Republican', 'Democratic-Farmer-Labor', 'Independent'.
  • surnamefamily name
  • givennamefirst name with possibly a middle name, nickname, and suffix (e.g., Jr., III).

Details

Convert the two into a common format and rbind.

See Also

readUShouse readUSsenate

Examples

Run this code
if(!fda::CRAN()){
house <- readUShouse()

USreps <- UShouse.senate(house)
}

Run the code above in your browser using DataLab