Title: | Data Utilities for Congressional Research |
Version: | 0.4.0 |
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. |
License: | MIT + file LICENSE |
URL: | https://feinleib.github.io/filibustr/, https://github.com/feinleib/filibustr |
BugReports: | https://github.com/feinleib/filibustr/issues |
Depends: | R (≥ 4.1.0) |
Imports: | cli, dplyr, furrr, future, haven, httr2, lifecycle, purrr, readr, rlang, rvest, stringr, tidyr, tools |
Suggests: | testthat (≥ 3.0.0) |
Config/testthat/edition: | 3 |
Encoding: | UTF-8 |
RoxygenNote: | 7.3.2 |
NeedsCompilation: | no |
Packaged: | 2025-05-11 15:24:38 UTC; mhfeinleib |
Author: | Max Feinleib |
Maintainer: | Max Feinleib <mhfeinleib@gmail.com> |
Repository: | CRAN |
Date/Publication: | 2025-05-11 15:40:05 UTC |
filibustr: 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.
Author(s)
Maintainer: Max Feinleib mhfeinleib@gmail.com (ORCID) [copyright holder]
See Also
Useful links:
Report bugs at https://github.com/feinleib/filibustr/issues
Calculate the Congress number of a given year
Description
This function gives the number of the Congress for a specified calendar year.
Usage
congress_in_year(year)
Arguments
year |
Either a number or a Date object. Cannot be earlier than 1789, the year of the first Congress. |
Details
A new Congress begins in every odd-numbered year, starting in 1789. For example, 2021-2022 was the 117th Congress.
Value
A positive whole number.
Examples
congress_in_year(1800)
congress_in_year(2022)
Calculate the current Congress number
Description
This function gives the number of the Congress for the
current calendar year, using Sys.Date()
.
Usage
current_congress()
Details
A new Congress begins in every odd-numbered year, starting in 1789. For example, 2021-2022 was the 117th Congress.
Value
A positive whole number.
Examples
current_congress()
Get replication data from Harbridge-Yong, Volden, and Wiseman (2023)
Description
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
Usage
get_hvw_data(chamber, local_path = NULL)
Arguments
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 |
Details
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.
Value
A tibble.
Examples
get_hvw_data("senate")
get_hvw_data("house")
Get Legislative Effectiveness Scores data
Description
get_les()
returns
Legislative Effectiveness Scores data
from the Center for Effective Lawmaking.
Usage
get_les(chamber, les_2 = FALSE, local_path = NULL)
Arguments
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 There are non-trivial differences between the House and Senate datasets, so take care when joining House and Senate data. Important differences include:
|
les_2 |
Whether to use LES 2.0 (instead of Classic Legislative Effectiveness Scores). LES 2.0 credits lawmakers when language from their sponsored bills is included in other legislators' bills that become law. LES 2.0 is only available for the 117th Congress. Classic LES is available for the 93rd through 117th Congresses. |
local_path |
(Optional) A file path for reading from a local file.
If no |
Details
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
Value
A tibble.
Examples
# Classic LES data (93rd-117th Congresses)
get_les("house", les_2 = FALSE)
get_les("senate", les_2 = FALSE)
# LES 2.0 (117th Congress)
get_les("house", les_2 = TRUE)
get_les("senate", les_2 = TRUE)
Senate cloture motions and votes
Description
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.
Usage
get_senate_cloture_votes()
Details
The data is sourced from the official Senate website, specifically https://www.senate.gov/legislative/cloture/clotureCounts.htm.
Value
A tibble with the number of cloture motions, cloture votes, and successful cloture votes in each Congress.
Examples
get_senate_cloture_votes()
Start and end dates of Senate sessions
Description
get_senate_sessions()
returns a tibble with the beginning (convening) and
ending (adjournment) dates of each legislative session of the Senate.
Usage
get_senate_sessions()
Details
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.
Value
A tibble with the begin_date
and adjourn_date
of each
session of the Senate.
Examples
get_senate_sessions()
Key to Voteview cast codes in individual member votes
Description
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()
).
Usage
get_voteview_cast_codes()
Details
For more information on these cast codes, visit Voteview's article on the member votes data.
Value
A tibble.
See Also
get_voteview_member_votes()
, which uses these cast codes.
Examples
get_voteview_cast_codes()
Get data on the votes of individual members of Congress
Description
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()
.
Usage
get_voteview_member_votes(chamber = "all", congress = NULL, local_path = NULL)
Arguments
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
|
Details
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 (2025). Voteview: Congressional Roll-Call Votes Database. https://voteview.com/
Value
A tibble.
See Also
get_voteview_cast_codes()
for a dictionary of
the cast codes in this data.
Examples
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 data on members of Congress from Voteview
Description
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).
Usage
get_voteview_members(chamber = "all", congress = NULL, local_path = NULL)
Arguments
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
|
Details
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 (2025). Voteview: Congressional Roll-Call Votes Database. https://voteview.com/
Value
A tibble.
The tibble includes data on the member's office, party, and ideology. See Voteview for descriptions of specific columns.
Examples
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 data on congressional parties from Voteview
Description
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).
Usage
get_voteview_parties(chamber = "all", congress = NULL, local_path = NULL)
Arguments
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
|
Details
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 (2025). Voteview: Congressional Roll-Call Votes Database. https://voteview.com/
Value
A tibble.
Examples
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 data on congressional roll call votes from Voteview
Description
get_voteview_rollcall_votes()
returns a tibble with information on recorded
(roll call) votes in the House and Senate.
Usage
get_voteview_rollcall_votes(
chamber = "all",
congress = NULL,
local_path = NULL
)
Arguments
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
|
Details
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 (2025). Voteview: Congressional Roll-Call Votes Database. https://voteview.com/
Value
A tibble.
Examples
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)
Scrape an online HTML table
Description
read_html_table()
returns an HTML table at a specified URL and CSS element
as a dataframe.
Usage
read_html_table(url, css)
Arguments
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 |
Value
A tibble.
Examples
# The table used in `get_senate_cloture_votes()`
# NOTE: `get_senate_cloture_votes()` performs some cleaning on this table
read_html_table(url = "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")
Get the starting year of a Congress
Description
This function gives the first year for a specified Congress number.
Usage
year_of_congress(congress)
Arguments
congress |
A positive whole number. |
Details
A new Congress begins in every odd-numbered year, starting in 1789. For example, 2021-2022 was the 117th Congress.
Value
A positive whole number, representing the first year of the given Congress. This year will always be an odd number.
Examples
year_of_congress(1)
year_of_congress(118)