Nothing
local_path
(#17).Here is some example usage of the local_path
argument, including the ability
to filter local files:
## download large dataset
all_members <- get_voteview_members()
nrow(all_members) # 51036
levels(all_members$chamber) # "President" "House" "Senate"
range(all_members$congress) # 1 119 (or the `current_congress()`)
## save to local file
tmp_csv <- tempfile(fileext = ".csv")
readr::write_csv(all_members, tmp_csv)
## read data from local file - much faster than downloading from online!
local_members <- get_voteview_members(local_path = tmp_csv)
nrow(local_members) # 51036
## read smaller datasets from the local file
senators <- get_voteview_members(chamber = "sen", local_path = tmp_csv)
nrow(senators) # 10125
levels(senators$chamber) # "President" "Senate"
congresses_100_to_110 <- get_voteview_members(congress = 100:110,
local_path = tmp_csv)
nrow(congresses_100_to_110) # 6008
range(congresses_100_to_110$congress) # 100 110
house_117 <- get_voteview_members(chamber = "hr", congress = 117,
local_path = tmp_csv)
nrow(house_117) # 457
levels(house_117$chamber) # "President" "House"
range(house_117$congress) # 117 117
congress
now produces an error,
instead of silently returning data for all Congresses.get_les()
, returned data frames now use more specific column types, such
as integer for count data and logical for binary data (#10).state
, st_name
) and LES scores
relative to expectation (columns expectation
, expectation1
,
expectation2
) are now factor variables.get_voteview_members()
: fix factor levels in the state_abbrev
column.get_les()
, 0- or 1-character strings for bioname
are converted to NA
.get_voteview_cast_codes()
provides the cast codes used in Voteview's
member votes data (#13).read_html_table()
for reading HTML tables from online. It's a nice
shortcut for a common {rvest} workflow that otherwise takes 3 functions.
read_html_table()
was previously an internal function, but it's useful
enough that I think it should be exported, even if it's not a core
functionality of {filibustr} (#20).cli::cli_abort()
(#9).get_lhy_data()
has been renamed to get_hvw_data()
.get_voteview_*()
, chamber
and congress
now come before local
and
local_dir
. This matches the argument order in get_hvw_data()
(#3).get_les()
retrieves Legislative Effectiveness Scores data from
the Center for Effective Lawmaking (#5).Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.