-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
98 lines (70 loc) · 2.08 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
library(voteviewr)
options(width = 90)
```
# voteviewr
<!-- badges: start -->
[![Travis build status](https://travis-ci.org/r-congress/voteviewr.svg?branch=master)](https://travis-ci.org/r-congress/voteviewr)
[![AppVeyor build status](https://ci.appveyor.com/api/projects/status/github/r-congress/voteviewr?branch=master&svg=true)](https://ci.appveyor.com/project/r-congress/voteviewr)
[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://www.tidyverse.org/lifecycle/#experimental)
[![CRAN status](https://www.r-pkg.org/badges/version/voteviewr)](https://CRAN.R-project.org/package=voteviewr)
<!-- badges: end -->
Get data from [Voteview.com](https://voteview.com/data)
## Installation
You can install the released version of voteviewr from [CRAN](https://CRAN.R-project.org) with:
``` r
install.packages("voteviewr")
```
You can install the dev version of voteviewr from [Github](https://github.com) with:
``` r
if (!requireNamespace("remotes")) {
install.packages("remotes")
}
remotes::install_packages("r-congress/voteviewr")
```
## Import
Import Voteview data from the House and Senate for the 116th U.S. Congress
```{r}
## read using defaults (both chambers of current congress)
cng116 <- read_voteview()
```
or get data from the House and Senate separately for the 115th U.S. Congress
``` r
## house 115th data
h115 <- read_voteview("house", 115)
## senate 115th data
s115 <- read_voteview("senate", "115th")
```
or specify a session of Congress
``` r
## both chambers of 99th Congress
cng99 <- read_voteview(99)
##
cng99 <- read_voteview(99, "senate")
```
or specify a year
``` r
## get data on the 99th Congress
cng1961 <- read_voteview(1961)
```
## Data
A tibble is returned
```{r}
## preview tibble
cng116
```
More info on all returned variables
```{r}
## view object structure
str(cng116)
```