| Title: | Data Utilities for Congressional Research |
|---|---|
| Description: | Provides easy-to-understand and consistent interfaces for accessing data on the U.S. Congress. The functions in 'filibustr' streamline the process for importing data on Congress into R, removing the need to download and work from CSV files and the like. Data sources include 'Voteview' (<https://voteview.com/>), the U.S. Senate website (<https://www.senate.gov/>), and more. |
| Authors: | Max Feinleib [aut, cre, cph] (ORCID: <https://orcid.org/0009-0002-9604-3533>) |
| Maintainer: | Max Feinleib <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.5.2.9000 |
| Built: | 2026-06-09 06:14:49 UTC |
| Source: | https://github.com/feinleib/filibustr |
This function gives the number of the Congress for a specified calendar year.
congress_in_year(year)congress_in_year(year)
year |
Either a number or a Date object. Cannot be earlier than 1789, the year of the first Congress. |
A new Congress begins in every odd-numbered year, starting in 1789. For example, 2021-2022 was the 117th Congress.
A positive whole number.
congress_in_year(1800) congress_in_year(2022)congress_in_year(1800) congress_in_year(2022)
This function gives the number of the Congress for the
current calendar year, using Sys.Date().
current_congress()current_congress()
A new Congress begins in every odd-numbered year, starting in 1789. For example, 2021-2022 was the 117th Congress.
A positive whole number.
current_congress()current_congress()
get_hvw_data() returns replication data from:
Harbridge-Yong, L., Volden, C., & Wiseman, A. E. (2023). The bipartisan path to effective lawmaking. The Journal of Politics, 85(3), 1048–1063. doi:10.1086/723805
get_hvw_data(chamber, local_path = NULL)get_hvw_data(chamber, local_path = NULL)
chamber |
Which chamber to get data for. Options are:
These options are case-insensitive. Any other argument results in an error. Note: Unlike the Voteview functions, there is no You must specify either House or Senate data, since there is no "default" option. |
local_path |
(Optional) A file path for reading from a local file.
If no |
The replication data is available at the Harvard Dataverse (doi:10.7910/DVN/EARLA4).
The House and Senate data come from the files
HarbridgeYong_Volden_Wiseman_House_Replication.tab and
HarbridgeYong_Volden_Wiseman_Senate_Replication.tab, respectively.
The data spans the 93rd through 114th Congresses (1973-2016).
These datasets have been dedicated to the public domain under CC0 1.0.
A tibble.
get_hvw_data("senate") get_hvw_data("house")get_hvw_data("senate") get_hvw_data("house")
get_les() returns
Legislative Effectiveness Scores data
from the Center for Effective Lawmaking.
get_les(chamber, les_2 = deprecated(), local_path = NULL)get_les(chamber, les_2 = deprecated(), local_path = NULL)
See the Center for Effective Lawmaking website for more information on their data.
The Legislative Effectiveness Score methodology was introduced in:
Volden, C., & Wiseman, A. E. (2014). Legislative effectiveness in the United States Congress: The lawmakers. Cambridge University Press. doi:10.1017/CBO9781139032360
The Center for Effective Lawmaking created a new version of LES starting in the 117th Congress. LES 2.0 credits lawmakers when language from their sponsored bills is included in other legislators' bills that advance through Congress and become law, not just their own sponsored bills. LES 2.0 is only available starting in the 117th Congress (2021-present). LES Classic goes back to the 93rd Congress (1973-present).
See the LES methodology page for more information on these methods.
A tibble.
get_les("house") get_les("senate")get_les("house") get_les("senate")
get_senate_cloture_votes() returns a tibble of the number of cloture motions,
cloture votes, and successful cloture votes in the Senate during each Congress
since 1917.
get_senate_cloture_votes()get_senate_cloture_votes()
The data is sourced from the official Senate website, specifically https://www.senate.gov/legislative/cloture/clotureCounts.htm.
A tibble with the number of cloture motions, cloture votes, and successful cloture votes in each Congress.
get_senate_cloture_votes()get_senate_cloture_votes()
get_senate_sessions() returns a tibble with the beginning (convening) and
ending (adjournment) dates of each legislative session of the Senate.
get_senate_sessions()get_senate_sessions()
The data is sourced from the official Senate website, specifically https://www.senate.gov/legislative/DatesofSessionsofCongress.htm.
Senate sessions explained
That webpage provides this explanation of Senate sessions:
Prior to the 74th Congress (1935-1937), the first session of a Congress officially began on March 4 of odd-numbered years and ended at midnight on March 3 of odd-numbered years. Since 1935, in accordance with the 20th Amendment to the Constitution, Congresses have begun and ended at noon on January 3 of odd-numbered years. Each two-year Congress typically includes two legislative sessions, although third or special sessions were common in earlier years.
The session column
The session column is type factor, with the following levels:
levels(get_senate_sessions()$session) #> [1] "1" "2" "3" "4" "S" # Note: That's a letter S, not a number 5!
The Senate has had just 2 sessions in each Congress since 1941, so if you
are just working with more recent data, you could convert this column to
numeric. However, if you are working with pre-1941 data, you will likely
be dealing with special sessions (denoted "S"), not just numbered
sessions.
A tibble with the begin_date and adjourn_date of each
session of the Senate.
get_senate_sessions()get_senate_sessions()
get_voteview_cast_codes() returns a tibble with definitions
of the 10 cast codes used in Voteview's member votes data
(i.e., the cast_code column in the data frames from
get_voteview_member_votes()).
get_voteview_cast_codes()get_voteview_cast_codes()
For more information on these cast codes, visit Voteview's article on the member votes data.
A tibble.
get_voteview_member_votes(), which uses these cast codes.
get_voteview_cast_codes()get_voteview_cast_codes()
get_voteview_member_votes() returns a tibble that lists how each member
of Congress voted in recorded (roll call) votes in the House and Senate.
Members are identified by their ICPSR ID number, which you can use to
join with additional member data from get_voteview_members().
get_voteview_member_votes(chamber = "all", congress = NULL, local_path = NULL)get_voteview_member_votes(chamber = "all", congress = NULL, local_path = NULL)
chamber |
Which chamber to get data for. Options are:
These options are case-insensitive. If you explicitly pass a different value, it will default to "all" with a warning. |
congress |
(Optional) A whole number (to get data for a single Congress), or a numeric vector (to get data for a set of congresses). If not provided, will retrieve data for all Congresses by default.
If specified, Congress numbers cannot be greater than the |
local_path |
(Optional) A file path for reading from a local file. If no
|
See the Voteview website for more information on their data.
Please cite this dataset as:
Lewis, Jeffrey B., Keith Poole, Howard Rosenthal, Adam Boche, Aaron Rudkin, and Luke Sonnet (2026). Voteview: Congressional Roll-Call Votes Database. https://voteview.com/
A tibble.
If you have installed the packages mirai and carrier, then the Voteview functions can download Voteview data from multiple Congresses in parallel.
To download Voteview data in parallel, use mirai::daemons() to create
parallel processes. If you are downloading Voteview data for many
Congresses, this can provide a significant speed-up.
See vignette("parallel-downloads") for full usage details.
get_voteview_cast_codes() for a dictionary of
the cast codes in this data.
get_voteview_member_votes() # Get data for only one chamber get_voteview_member_votes(chamber = "house") get_voteview_member_votes(chamber = "senate") # Get data for a specific Congress get_voteview_member_votes(congress = 110) get_voteview_member_votes(congress = current_congress()) # Get data for a set of Congresses get_voteview_member_votes(congress = 1:3)get_voteview_member_votes() # Get data for only one chamber get_voteview_member_votes(chamber = "house") get_voteview_member_votes(chamber = "senate") # Get data for a specific Congress get_voteview_member_votes(congress = 110) get_voteview_member_votes(congress = current_congress()) # Get data for a set of Congresses get_voteview_member_votes(congress = 1:3)
get_voteview_members() returns a tibble of data on members of Congress,
sourced from Voteview. Members in the data include
Senators, Representatives, and Presidents. Each row is one member in one
Congress (i.e., each member is listed once for every two years in office).
get_voteview_members(chamber = "all", congress = NULL, local_path = NULL)get_voteview_members(chamber = "all", congress = NULL, local_path = NULL)
chamber |
(Optional) Which chamber to get data for. Options are:
These options are case-insensitive. If you explicitly pass a different value, it will default to "all" with a warning. Note that presidents are included in all datasets. Therefore, reading both |
congress |
(Optional) A whole number (to get data for a single Congress), or a numeric vector (to get data for a set of congresses). If not provided, will retrieve data for all Congresses by default.
If specified, Congress numbers cannot be greater than the |
local_path |
(Optional) A file path for reading from a local file. If no
|
See the Voteview website for more information on their data.
Please cite this dataset as:
Lewis, Jeffrey B., Keith Poole, Howard Rosenthal, Adam Boche, Aaron Rudkin, and Luke Sonnet (2026). Voteview: Congressional Roll-Call Votes Database. https://voteview.com/
A tibble.
The tibble includes data on the member's office, party, and ideology. See Voteview for descriptions of specific columns.
If you have installed the packages mirai and carrier, then the Voteview functions can download Voteview data from multiple Congresses in parallel.
To download Voteview data in parallel, use mirai::daemons() to create
parallel processes. If you are downloading Voteview data for many
Congresses, this can provide a significant speed-up.
See vignette("parallel-downloads") for full usage details.
get_voteview_members() # Get data for only one chamber # NOTE: the President is included in all data get_voteview_members(chamber = "house") get_voteview_members(chamber = "senate") # Get data for a specific Congress get_voteview_members(congress = 100) get_voteview_members(congress = current_congress()) # Get data for a set of Congresses get_voteview_members(congress = 1:10)get_voteview_members() # Get data for only one chamber # NOTE: the President is included in all data get_voteview_members(chamber = "house") get_voteview_members(chamber = "senate") # Get data for a specific Congress get_voteview_members(congress = 100) get_voteview_members(congress = current_congress()) # Get data for a set of Congresses get_voteview_members(congress = 1:10)
get_voteview_parties() returns a tibble with information on the parties (aka caucuses)
in each Congress. The party information includes a party's ICPSR code, number of
members, and DW-NOMINATE scores.
The parties of the President, Senate, and House are listed in the data. Each row is one party in one chamber for each Congress (i.e., each party is listed once for every two years).
get_voteview_parties(chamber = "all", congress = NULL, local_path = NULL)get_voteview_parties(chamber = "all", congress = NULL, local_path = NULL)
chamber |
(Optional) Which chamber to get data for. Options are:
These options are case-insensitive. If you explicitly pass a different value, it will default to "all" with a warning. Note that presidents are included in all datasets. Therefore, reading both |
congress |
(Optional) A whole number (to get data for a single Congress), or a numeric vector (to get data for a set of congresses). If not provided, will retrieve data for all Congresses by default.
If specified, Congress numbers cannot be greater than the |
local_path |
(Optional) A file path for reading from a local file. If no
|
See the Voteview website for more information on their data.
Please cite this dataset as:
Lewis, Jeffrey B., Keith Poole, Howard Rosenthal, Adam Boche, Aaron Rudkin, and Luke Sonnet (2026). Voteview: Congressional Roll-Call Votes Database. https://voteview.com/
A tibble.
If you have installed the packages mirai and carrier, then the Voteview functions can download Voteview data from multiple Congresses in parallel.
To download Voteview data in parallel, use mirai::daemons() to create
parallel processes. If you are downloading Voteview data for many
Congresses, this can provide a significant speed-up.
See vignette("parallel-downloads") for full usage details.
get_voteview_parties() # get parties for only one chamber # NOTE: the President is included in all data get_voteview_parties(chamber = "house") get_voteview_parties(chamber = "senate") # get parties for a specific Congress get_voteview_parties(congress = 100) get_voteview_parties(congress = current_congress()) # get parties for a set of Congresses get_voteview_parties(congress = 1:10)get_voteview_parties() # get parties for only one chamber # NOTE: the President is included in all data get_voteview_parties(chamber = "house") get_voteview_parties(chamber = "senate") # get parties for a specific Congress get_voteview_parties(congress = 100) get_voteview_parties(congress = current_congress()) # get parties for a set of Congresses get_voteview_parties(congress = 1:10)
get_voteview_rollcall_votes() returns a tibble with information on recorded
(roll call) votes in the House and Senate.
get_voteview_rollcall_votes( chamber = "all", congress = NULL, local_path = NULL )get_voteview_rollcall_votes( chamber = "all", congress = NULL, local_path = NULL )
chamber |
Which chamber to get data for. Options are:
These options are case-insensitive. If you explicitly pass a different value, it will default to "all" with a warning. |
congress |
(Optional) A whole number (to get data for a single Congress), or a numeric vector (to get data for a set of congresses). If not provided, will retrieve data for all Congresses by default.
If specified, Congress numbers cannot be greater than the |
local_path |
(Optional) A file path for reading from a local file. If no
|
See the Voteview website for more information on their data.
Please cite this dataset as:
Lewis, Jeffrey B., Keith Poole, Howard Rosenthal, Adam Boche, Aaron Rudkin, and Luke Sonnet (2026). Voteview: Congressional Roll-Call Votes Database. https://voteview.com/
A tibble.
If you have installed the packages mirai and carrier, then the Voteview functions can download Voteview data from multiple Congresses in parallel.
To download Voteview data in parallel, use mirai::daemons() to create
parallel processes. If you are downloading Voteview data for many
Congresses, this can provide a significant speed-up.
See vignette("parallel-downloads") for full usage details.
get_voteview_rollcall_votes() # Get data for only one chamber # NOTE: the President is included in all data get_voteview_rollcall_votes(chamber = "house") get_voteview_rollcall_votes(chamber = "senate") # Get data for a specific Congress get_voteview_rollcall_votes(congress = 100) get_voteview_rollcall_votes(congress = current_congress()) # Get data for a set of Congresses get_voteview_rollcall_votes(congress = 1:10)get_voteview_rollcall_votes() # Get data for only one chamber # NOTE: the President is included in all data get_voteview_rollcall_votes(chamber = "house") get_voteview_rollcall_votes(chamber = "senate") # Get data for a specific Congress get_voteview_rollcall_votes(congress = 100) get_voteview_rollcall_votes(congress = current_congress()) # Get data for a set of Congresses get_voteview_rollcall_votes(congress = 1:10)
read_html_table() returns an HTML table at a specified URL and CSS element
as a dataframe.
read_html_table(url, css)read_html_table(url, css)
url |
A string giving the URL to read from. |
css |
A string giving the CSS element to select. SelectorGadget
(https://selectorgadget.com/) is a useful tool for finding the code for the
CSS element you need. See |
A tibble.
# The table used in `get_senate_cloture_votes()` # NOTE: `get_senate_cloture_votes()` performs some cleaning on this table read_html_table("https://www.senate.gov/legislative/cloture/clotureCounts.htm", css = ".cloturecount") # A table from Baseball Reference read_html_table(url = "https://www.baseball-reference.com/friv/rules-changes-stats.shtml", css = "#time_of_game")# The table used in `get_senate_cloture_votes()` # NOTE: `get_senate_cloture_votes()` performs some cleaning on this table read_html_table("https://www.senate.gov/legislative/cloture/clotureCounts.htm", css = ".cloturecount") # A table from Baseball Reference read_html_table(url = "https://www.baseball-reference.com/friv/rules-changes-stats.shtml", css = "#time_of_game")
This function gives the first year for a specified Congress number.
year_of_congress(congress)year_of_congress(congress)
congress |
A positive whole number. |
A new Congress begins in every odd-numbered year, starting in 1789. For example, 2021-2022 was the 117th Congress.
A positive whole number, representing the first year of the given Congress. This year will always be an odd number.
year_of_congress(1) year_of_congress(118)year_of_congress(1) year_of_congress(118)