├── .codecov.yml ├── NEWS.md ├── README_cache └── gfm │ ├── unnamed-chunk-5_b805940375e22d06aa869baa4a57616d.rdb │ ├── unnamed-chunk-6_b62f1e0e2bf3b6caafa48c4294953dea.rdb │ ├── __packages │ ├── unnamed-chunk-5_b805940375e22d06aa869baa4a57616d.rdx │ ├── unnamed-chunk-6_b62f1e0e2bf3b6caafa48c4294953dea.rdx │ ├── unnamed-chunk-5_b805940375e22d06aa869baa4a57616d.RData │ └── unnamed-chunk-6_b62f1e0e2bf3b6caafa48c4294953dea.RData ├── tests ├── test-all.R └── testthat │ └── test-elpresidente.R ├── R ├── aaa.R ├── elpresidente-package.R ├── app-eo-list.R ├── app-get-ia.R └── app-get-eo.R ├── .gitignore ├── .travis.yml ├── .Rbuildignore ├── man ├── elpresidente.Rd ├── app_get_inaugurals.Rd ├── app_eo_list.Rd └── app_get_eo.Rd ├── elpresidente.Rproj ├── NAMESPACE ├── DESCRIPTION ├── README.Rmd └── README.md /.codecov.yml: -------------------------------------------------------------------------------- 1 | comment: false 2 | -------------------------------------------------------------------------------- /NEWS.md: -------------------------------------------------------------------------------- 1 | 0.1.0 2 | * Initial release 3 | -------------------------------------------------------------------------------- /README_cache/gfm/unnamed-chunk-5_b805940375e22d06aa869baa4a57616d.rdb: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /README_cache/gfm/unnamed-chunk-6_b62f1e0e2bf3b6caafa48c4294953dea.rdb: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/test-all.R: -------------------------------------------------------------------------------- 1 | library(testthat) 2 | test_check("elpresidente") 3 | -------------------------------------------------------------------------------- /R/aaa.R: -------------------------------------------------------------------------------- 1 | utils::globalVariables( 2 | c(".", "data_frame", "eo_num", "potus", "title") 3 | ) -------------------------------------------------------------------------------- /README_cache/gfm/__packages: -------------------------------------------------------------------------------- 1 | base 2 | elpresidente 3 | purrr 4 | tidyr 5 | dplyr 6 | bindrcpp 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .Rproj.user 3 | .Rhistory 4 | .RData 5 | .Rproj 6 | src/*.o 7 | src/*.so 8 | src/*.dll 9 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: R 2 | sudo: false 3 | cache: packages 4 | 5 | after_success: 6 | - Rscript -e 'covr::codecov()' 7 | -------------------------------------------------------------------------------- /tests/testthat/test-elpresidente.R: -------------------------------------------------------------------------------- 1 | context("minimal package functionality") 2 | test_that("we can do something", { 3 | 4 | #expect_that(some_function(), is_a("data.frame")) 5 | 6 | }) 7 | -------------------------------------------------------------------------------- /README_cache/gfm/unnamed-chunk-5_b805940375e22d06aa869baa4a57616d.rdx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hrbrmstr/elpresidente/HEAD/README_cache/gfm/unnamed-chunk-5_b805940375e22d06aa869baa4a57616d.rdx -------------------------------------------------------------------------------- /README_cache/gfm/unnamed-chunk-6_b62f1e0e2bf3b6caafa48c4294953dea.rdx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hrbrmstr/elpresidente/HEAD/README_cache/gfm/unnamed-chunk-6_b62f1e0e2bf3b6caafa48c4294953dea.rdx -------------------------------------------------------------------------------- /README_cache/gfm/unnamed-chunk-5_b805940375e22d06aa869baa4a57616d.RData: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hrbrmstr/elpresidente/HEAD/README_cache/gfm/unnamed-chunk-5_b805940375e22d06aa869baa4a57616d.RData -------------------------------------------------------------------------------- /README_cache/gfm/unnamed-chunk-6_b62f1e0e2bf3b6caafa48c4294953dea.RData: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hrbrmstr/elpresidente/HEAD/README_cache/gfm/unnamed-chunk-6_b62f1e0e2bf3b6caafa48c4294953dea.RData -------------------------------------------------------------------------------- /.Rbuildignore: -------------------------------------------------------------------------------- 1 | ^.*\.Rproj$ 2 | ^\.Rproj\.user$ 3 | ^\.travis\.yml$ 4 | ^README\.*Rmd$ 5 | ^README\.*html$ 6 | ^NOTES\.*Rmd$ 7 | ^NOTES\.*html$ 8 | ^\.codecov\.yml$ 9 | ^README_files$ 10 | ^doc$ 11 | ^tmp$ 12 | -------------------------------------------------------------------------------- /man/elpresidente.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/elpresidente-package.R 3 | \docType{package} 4 | \name{elpresidente} 5 | \alias{elpresidente} 6 | \alias{elpresidente-package} 7 | \title{Search and Extract Corpus Elements from 'The American Presidency Project'} 8 | \description{ 9 | Search and Extract Corpus Elements from 'The American Presidency Project' 10 | } 11 | \author{ 12 | Bob Rudis (bob@rud.is) 13 | } 14 | -------------------------------------------------------------------------------- /elpresidente.Rproj: -------------------------------------------------------------------------------- 1 | Version: 1.0 2 | 3 | RestoreWorkspace: Default 4 | SaveWorkspace: Default 5 | AlwaysSaveHistory: Default 6 | 7 | EnableCodeIndexing: Yes 8 | UseSpacesForTab: Yes 9 | NumSpacesForTab: 2 10 | Encoding: UTF-8 11 | 12 | RnwWeave: Sweave 13 | LaTeX: pdfLaTeX 14 | 15 | StripTrailingWhitespace: Yes 16 | 17 | BuildType: Package 18 | PackageUseDevtools: Yes 19 | PackageInstallArgs: --no-multiarch --with-keep.source 20 | PackageBuildArgs: --resave-data 21 | PackageRoxygenize: rd,collate,namespace 22 | -------------------------------------------------------------------------------- /man/app_get_inaugurals.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/app-get-ia.R 3 | \name{app_get_inaugurals} 4 | \alias{app_get_inaugurals} 5 | \title{Retrieve metadata and full text for Presidential Inaugural Addresses} 6 | \usage{ 7 | app_get_inaugurals() 8 | } 9 | \description{ 10 | Retrieve metadata and full text for Presidential Inaugural Addresses 11 | } 12 | \examples{ 13 | inaug_df <- app_get_inaugurals() 14 | } 15 | \references{ 16 | \url{http://www.presidency.ucsb.edu/inaugurals.php} 17 | } 18 | -------------------------------------------------------------------------------- /R/elpresidente-package.R: -------------------------------------------------------------------------------- 1 | #' Search and Extract Corpus Elements from 'The American Presidency Project' 2 | #' 3 | #' Search and Extract Corpus Elements from 'The American Presidency Project' 4 | #' 5 | #' @md 6 | #' @name elpresidente 7 | #' @docType package 8 | #' @author Bob Rudis (bob@@rud.is) 9 | #' @importFrom purrr map_df map_chr flatten_dfc map set_names %>% 10 | #' @importFrom dplyr mutate select progress_estimated 11 | #' @importFrom rvest html_nodes html_text html_node html_children html_attr 12 | #' @importFrom xml2 read_html 13 | #' @importFrom tidyr unnest 14 | #' @importFrom lubridate mdy 15 | #' @import stringi 16 | NULL 17 | -------------------------------------------------------------------------------- /NAMESPACE: -------------------------------------------------------------------------------- 1 | # Generated by roxygen2: do not edit by hand 2 | 3 | export(app_eo_list) 4 | export(app_get_eo) 5 | export(app_get_inaugurals) 6 | import(stringi) 7 | importFrom(dplyr,mutate) 8 | importFrom(dplyr,progress_estimated) 9 | importFrom(dplyr,select) 10 | importFrom(lubridate,mdy) 11 | importFrom(purrr,"%>%") 12 | importFrom(purrr,flatten_dfc) 13 | importFrom(purrr,map) 14 | importFrom(purrr,map_chr) 15 | importFrom(purrr,map_df) 16 | importFrom(purrr,set_names) 17 | importFrom(rvest,html_attr) 18 | importFrom(rvest,html_children) 19 | importFrom(rvest,html_node) 20 | importFrom(rvest,html_nodes) 21 | importFrom(rvest,html_text) 22 | importFrom(tidyr,unnest) 23 | importFrom(xml2,read_html) 24 | -------------------------------------------------------------------------------- /man/app_eo_list.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/app-eo-list.R 3 | \name{app_eo_list} 4 | \alias{app_eo_list} 5 | \title{Retieve a data frame of metadata about Executive Orders issues in a given year} 6 | \usage{ 7 | app_eo_list(year) 8 | } 9 | \arguments{ 10 | \item{year}{a value > 1826 and less then last month's year} 11 | } 12 | \value{ 13 | data frame (tibble) of \code{potus}, \code{eo_date}, \code{eo_title} and \code{eo_id}; 14 | Use \code{eo_id} for calls to \code{\link[=app_get_eo]{app_get_eo()}}. 15 | } 16 | \description{ 17 | Retieve a data frame of metadata about Executive Orders issues in a given year 18 | } 19 | \examples{ 20 | app_eo_list(1826) 21 | app_eo_list(2014) 22 | } 23 | \references{ 24 | \url{http://www.presidency.ucsb.edu/data/orders.php} 25 | } 26 | -------------------------------------------------------------------------------- /DESCRIPTION: -------------------------------------------------------------------------------- 1 | Package: elpresidente 2 | Type: Package 3 | Title: Search and Extract Corpus Elements from 'The American Presidency Project' 4 | Version: 0.1.0 5 | Date: 2018-04-22 6 | Authors@R: c( 7 | person("Bob", "Rudis", email = "bob@rud.is", role = c("aut", "cre"), 8 | comment = c(ORCID = "0000-0001-5670-2640")) 9 | ) 10 | Maintainer: Bob Rudis 11 | Description: Methods are provided that let you search and extract corpus elements 12 | from 'The American Presidency Project' . 13 | URL: https://github.com/hrbrmstr/elpresidente 14 | BugReports: https://github.com/hrbrmstr/elpresidente/issues 15 | Encoding: UTF-8 16 | License: AGPL 17 | Suggests: 18 | testthat, 19 | covr 20 | Depends: 21 | R (>= 3.2.0) 22 | Imports: 23 | dplyr, 24 | lubridate, 25 | rvest, 26 | stringi, 27 | tidyr, 28 | xml2, 29 | purrr 30 | RoxygenNote: 6.0.1.9000 31 | -------------------------------------------------------------------------------- /man/app_get_eo.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/app-get-eo.R 3 | \name{app_get_eo} 4 | \alias{app_get_eo} 5 | \title{Retrieve metadata and full text of an executive order by APP id} 6 | \usage{ 7 | app_get_eo(eo_id) 8 | } 9 | \arguments{ 10 | \item{eo_id}{a valid APP EO id (via \code{\link[=app_eo_list]{app_eo_list()}})} 11 | } 12 | \value{ 13 | data frame (tibble) with \code{date}, \code{eo_num}, \code{title}, \code{potus}, \code{eo_text}; 14 | NOTE that \code{eo_num} will be \code{NA} for older EOs without actual numbers. 15 | The \code{title} and \code{potus} and \code{date} should match up with the metadata 16 | retrieved in \code{\link[=app_eo_list]{app_eo_list()}}. Fields may be \code{NA} also due them being 17 | missing. 18 | } 19 | \description{ 20 | The APP has an id for each executive order. Use \code{\link[=app_eo_list]{app_eo_list()}} to 21 | find them and then call this function with one of those \code{eo_id}s. 22 | } 23 | \examples{ 24 | app_get_eo(104775) 25 | } 26 | \references{ 27 | \url{http://www.presidency.ucsb.edu/data/orders.php} 28 | } 29 | -------------------------------------------------------------------------------- /R/app-eo-list.R: -------------------------------------------------------------------------------- 1 | #' Retieve a data frame of metadata about Executive Orders issues in a given year 2 | #' 3 | #' @md 4 | #' @param year a value > 1826 and less then last month's year 5 | #' @return data frame (tibble) of `potus`, `eo_date`, `eo_title` and `eo_id`; 6 | #' Use `eo_id` for calls to [app_get_eo()]. 7 | #' @export 8 | #' @references 9 | #' @examples 10 | #' app_eo_list(1826) 11 | #' app_eo_list(2014) 12 | app_eo_list <- function(year) { 13 | 14 | # only handle one year 15 | year <- year[1] 16 | 17 | # none before! 18 | stopifnot(year >= 1826) 19 | 20 | # read the page 21 | xml2::read_html( 22 | sprintf("http://www.presidency.ucsb.edu/executive_orders.php?year=%s&Submit=DISPLAY", year) 23 | ) -> pg 24 | 25 | # yank out the table 26 | tab <- html_nodes(pg, xpath=".//form/following-sibling::table[tr[contains(td, 'President')]]") 27 | 28 | data_frame( 29 | 30 | potus = html_nodes(tab, xpath=".//td[1]") %>% # POTUS name 31 | html_text() %>% 32 | .[-1], 33 | 34 | eo_date = html_nodes(tab, xpath=".//td[2]") %>% # EO release date 35 | html_text() %>% 36 | .[-1] %>% 37 | lubridate::mdy(), 38 | 39 | eo_title = html_nodes(tab, xpath=".//td[3]/a") %>% # Title 40 | html_text(), 41 | 42 | eo_id = html_nodes(tab, xpath=".//td[3]/a") %>% # APP ID 43 | html_attr("href") %>% 44 | stringi::stri_replace_all_regex("^.*=","") 45 | 46 | ) 47 | 48 | } 49 | 50 | -------------------------------------------------------------------------------- /README.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | output: rmarkdown::github_document 3 | --- 4 | 5 | # elpresidente 6 | 7 | ## Description 8 | 9 | Methods are provided that let you search and extract corpus elements 10 | from 'The American Presidency Project' . 11 | 12 | ## What's Inside The Tin 13 | 14 | The following functions are implemented: 15 | 16 | - `app_eo_list`: Retieve a data frame of metadata about Executive Orders issues in a given year 17 | - `app_get_eo`: Retrieve metadata and full text of an executive order by APP id 18 | - `app_get_inaugurals`: Retrieve metadata and full text for Presidential Inaugural Addresses 19 | 20 | ## Installation 21 | 22 | ```{r eval=FALSE} 23 | devtools::install_github("hrbrmstr/elpresidente") 24 | ``` 25 | 26 | ```{r message=FALSE, warning=FALSE, error=FALSE, include=FALSE} 27 | options(width=120) 28 | ``` 29 | 30 | ## Usage 31 | 32 | ```{r message=FALSE, warning=FALSE, error=FALSE} 33 | library(elpresidente) 34 | 35 | # current verison 36 | packageVersion("elpresidente") 37 | 38 | ``` 39 | 40 | ## Example 41 | 42 | ```{r message=FALSE, warning=FALSE, error=FALSE} 43 | library(purrr) 44 | library(tidyr) 45 | library(dplyr) 46 | ``` 47 | 48 | ```{r cache=TRUE} 49 | app_eo_list(1826) %>% 50 | mutate(eo_info = map(eo_id, app_get_eo)) %>% 51 | unnest() %>% 52 | glimpse() 53 | 54 | app_eo_list(2014) %>% 55 | mutate(eo_info = map(eo_id, app_get_eo)) %>% 56 | unnest() %>% 57 | glimpse() 58 | ``` 59 | 60 | ```{r cache=TRUE} 61 | app_get_inaugurals() 62 | ``` -------------------------------------------------------------------------------- /R/app-get-ia.R: -------------------------------------------------------------------------------- 1 | #' Retrieve metadata and full text for Presidential Inaugural Addresses 2 | #' 3 | #' @md 4 | #' @references 5 | #' @export 6 | #' @examples 7 | #' inaug_df <- app_get_inaugurals() 8 | app_get_inaugurals <- function() { 9 | 10 | .get_ia <- function(ia_id) { 11 | 12 | sprintf("http://www.presidency.ucsb.edu/ws/index.php?pid=%s", ia_id) %>% 13 | purrr::map(xml2::read_html) %>% 14 | purrr::map_chr(~{ 15 | 16 | # get the text of the span itself since it's super bad HTML 17 | rvest::html_nodes(.x, xpath="//span[@class = 'displaytext']/text()") %>% 18 | rvest::html_text() -> span_txt 19 | 20 | # get the rest of the span (ugh) 21 | rvest::html_nodes(.x, xpath="//span[@class = 'displaytext']") %>% 22 | rvest::html_children() %>% 23 | purrr::map_chr(rvest::html_text) -> ia_text 24 | 25 | # smush them together 26 | paste0(c(span_txt, ia_text), collapse="\n") %>% 27 | stringi::stri_trim_both() 28 | 29 | }) 30 | 31 | } 32 | 33 | pg <- xml2::read_html("http://www.presidency.ucsb.edu/inaugurals.php") 34 | 35 | tab <- rvest::html_node(pg, xpath=".//td/table[tr[contains(td, 'President')]]") 36 | 37 | rows <- rvest::html_nodes(tab, xpath=".//tr[count(td) = 3]") 38 | 39 | purrr::map(rows, rvest::html_nodes, "td") %>% 40 | purrr::map(rvest::html_text) %>% 41 | purrr::map(purrr::set_names, c("potus", "date", "word_count")) %>% 42 | purrr::map(as.list) %>% 43 | dplyr::bind_rows() %>% 44 | dplyr::mutate_all(.funs=stringi::stri_trim_both) %>% 45 | dplyr::mutate(potus = ifelse(potus == "", NA_character_, potus)) %>% 46 | tidyr::fill(potus) %>% 47 | tail(-1) %>% 48 | dplyr::mutate(date = lubridate::mdy(date), word_count=as.integer(word_count)) %>% 49 | dplyr::mutate( 50 | ia_id = 51 | rvest::html_nodes(rows, xpath=".//td[2]") %>% 52 | purrr::map_chr(~rvest::html_node(.x, "a") %>% rvest::html_attr("href")) %>% 53 | tail(-1) %>% 54 | stringi::stri_replace_all_regex("^.*=", "") 55 | ) %>% 56 | dplyr::mutate(content = .get_ia(ia_id)) 57 | 58 | } 59 | -------------------------------------------------------------------------------- /R/app-get-eo.R: -------------------------------------------------------------------------------- 1 | #' Retrieve metadata and full text of an executive order by APP id 2 | #' 3 | #' The APP has an id for each executive order. Use [app_eo_list()] to 4 | #' find them and then call this function with one of those `eo_id`s. 5 | #' 6 | #' @md 7 | #' @param eo_id a valid APP EO id (via [app_eo_list()]) 8 | #' @return data frame (tibble) with `date`, `eo_num`, `title`, `potus`, `eo_text`; 9 | #' NOTE that `eo_num` will be `NA` for older EOs without actual numbers. 10 | #' The `title` and `potus` and `date` should match up with the metadata 11 | #' retrieved in [app_eo_list()]. Fields may be `NA` also due them being 12 | #' missing. 13 | #' @export 14 | #' @references 15 | #' @examples 16 | #' app_get_eo(104775) 17 | app_get_eo <- function(eo_id) { 18 | 19 | # can only be one eo_id 20 | eo_id <- eo_id[1] 21 | 22 | # get the page 23 | xml2::read_html( 24 | sprintf("http://www.presidency.ucsb.edu/ws/index.php?pid=%s", eo_id) 25 | ) -> pg 26 | 27 | # get the ugly title that we have to break down 28 | rvest::html_node(pg, xpath=".//title/following-sibling::meta") %>% 29 | rvest::html_attr("content") -> title_combined 30 | 31 | # get the text of the span itself since it's super bad HTML 32 | rvest::html_nodes(pg, xpath="//span[@class = 'displaytext']/text()") %>% 33 | rvest::html_text() -> span_txt 34 | 35 | # get the rest of the span (ugh) 36 | rvest::html_nodes(pg, xpath="//span[@class = 'displaytext']") %>% 37 | rvest::html_children() %>% 38 | purrr::map_chr(rvest::html_text) -> eo_text 39 | 40 | # smush them together 41 | paste0(c(span_txt, eo_text), collapse="\n") %>% 42 | stri_trim_both() -> eo_text 43 | 44 | # now try to parse the horribad title 45 | stringi::stri_split_regex(title_combined, "[:\u2014]| - ") %>% 46 | purrr::flatten_chr() %>% 47 | stri_trim_both() -> bits 48 | 49 | # older ones do not have all the info we need 50 | if (length(bits) == 3) { 51 | 52 | purrr::set_names(bits, c("potus", "title", "date")) %>% 53 | list() %>% 54 | purrr::flatten_dfc() %>% 55 | mutate(eo_num = NA_character_) -> eo_meta 56 | 57 | } else if (length(bits) == 4) { # newer ones do 58 | 59 | purrr::set_names(bits, c("potus", "eo_num", "title", "date")) %>% 60 | list() %>% 61 | purrr::flatten_dfc() -> eo_meta 62 | 63 | } 64 | 65 | # return a data frame 66 | 67 | dplyr::data_frame( 68 | title_combined = title_combined, 69 | eo_text = eo_text, 70 | eo_meta = list(eo_meta) 71 | ) %>% 72 | tidyr::unnest() %>% 73 | dplyr::mutate(title = ifelse(title == "Executive Order", NA_character_, title)) %>% 74 | dplyr::mutate(title = stringi::stri_trans_totitle(title)) %>% 75 | dplyr::mutate(eo_num = stringi::stri_replace_all_regex(eo_num, "[^[:digit:]]", "")) %>% 76 | dplyr::mutate(eo_num = ifelse(eo_num == "", NA_character_, eo_num)) %>% 77 | dplyr::mutate(date = lubridate::mdy(date)) %>% 78 | dplyr::select(date, eo_num, title, potus, eo_text) 79 | 80 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | # elpresidente 3 | 4 | ## Description 5 | 6 | Methods are provided that let you search and extract corpus elements 7 | from ‘The American Presidency Project’ . 8 | 9 | ## What’s Inside The Tin 10 | 11 | The following functions are implemented: 12 | 13 | - `app_eo_list`: Retieve a data frame of metadata about Executive 14 | Orders issues in a given year 15 | - `app_get_eo`: Retrieve metadata and full text of an executive order 16 | by APP id 17 | - `app_get_inaugurals`: Retrieve metadata and full text for 18 | Presidential Inaugural Addresses 19 | 20 | ## Installation 21 | 22 | ``` r 23 | devtools::install_github("hrbrmstr/elpresidente") 24 | ``` 25 | 26 | ## Usage 27 | 28 | ``` r 29 | library(elpresidente) 30 | 31 | # current verison 32 | packageVersion("elpresidente") 33 | ``` 34 | 35 | ## [1] '0.1.0' 36 | 37 | ## Example 38 | 39 | ``` r 40 | library(purrr) 41 | library(tidyr) 42 | library(dplyr) 43 | ``` 44 | 45 | ``` r 46 | app_eo_list(1826) %>% 47 | mutate(eo_info = map(eo_id, app_get_eo)) %>% 48 | unnest() %>% 49 | glimpse() 50 | ``` 51 | 52 | ## Observations: 1 53 | ## Variables: 9 54 | ## $ potus "John Quincy Adams" 55 | ## $ eo_date 1826-07-11 56 | ## $ eo_title "Executive Order" 57 | ## $ eo_id "66658" 58 | ## $ date 1826-07-11 59 | ## $ eo_num NA 60 | ## $ title NA 61 | ## $ potus1 "John Quincy Adams" 62 | ## $ eo_text "ADJUTANT-GENERAL'S OFFICE,\n GENERAL ORDERS.\nThe General in Chief has received from the Departme... 63 | 64 | ``` r 65 | app_eo_list(2014) %>% 66 | mutate(eo_info = map(eo_id, app_get_eo)) %>% 67 | unnest() %>% 68 | glimpse() 69 | ``` 70 | 71 | ## Observations: 31 72 | ## Variables: 9 73 | ## $ potus "Barack Obama", "Barack Obama", "Barack Obama", "Barack Obama", "Barack Obama", "Barack Obama", "B... 74 | ## $ eo_date 2014-01-17, 2014-02-10, 2014-02-12, 2014-02-19, 2014-03-06, 2014-03-16, 2014-03-20, 2014-03-20, 2... 75 | ## $ eo_title "Executive Order 13656—Establishment of the Afghanistan and Pakistan Strategic Partnership Office ... 76 | ## $ eo_id "104627", "104736", "104737", "104775", "104791", "104855", "104854", "104911", "104910", "104909"... 77 | ## $ date 2014-01-17, 2014-02-10, 2014-02-12, 2014-02-19, 2014-03-06, 2014-03-16, 2014-03-20, 2014-03-20, 2... 78 | ## $ eo_num "13656", "13657", "13658", "13659", "13660", "13661", "13662", "13663", "13664", "13665", "13666",... 79 | ## $ title "Establishment Of The Afghanistan And Pakistan Strategic Partnership Office And Amendment To Execu... 80 | ## $ potus1 "Barack Obama", "Barack Obama", "Barack Obama", "Barack Obama", "Barack Obama", "Barack Obama", "B... 81 | ## $ eo_text "By the authority vested in me as President by the Constitution and the laws of the United States ... 82 | 83 | ``` r 84 | app_get_inaugurals() 85 | ``` 86 | 87 | ## # A tibble: 58 x 5 88 | ## potus date word_count ia_id content 89 | ## 90 | ## 1 George Washington 1789-04-30 1431 25800 "Fellow-Citizens of the Senate and of the House of Representatives:\n… 91 | ## 2 George Washington 1793-03-04 135 25801 "Fellow Citizens:\nI AM again called upon by the voice of my country … 92 | ## 3 John Adams 1797-03-04 2321 25802 "WHEN it was first perceived, in early times, that no middle course f… 93 | ## 4 Thomas Jefferson 1801-03-04 1730 25803 "Friends and Fellow-Citizens:\nCALLED upon to undertake the duties of… 94 | ## 5 Thomas Jefferson 1805-03-04 2166 25804 "PROCEEDING, fellow-citizens, to that qualification which the Constit… 95 | ## 6 James Madison 1809-03-04 1177 25805 "Unwilling to depart from examples of the most revered authority, I a… 96 | ## 7 James Madison 1813-03-04 1211 25806 "About to add the solemnity of an oath to the obligations imposed by … 97 | ## 8 James Monroe 1817-03-04 3375 25807 "I should be destitute of feeling if I was not deeply affected by the… 98 | ## 9 James Monroe 1821-03-04 4472 25808 "Fellow-Citizens:\nI shall not attempt to describe the grateful emoti… 99 | ## 10 John Quincy Adams 1825-03-04 2915 25809 "In compliance with an usage coeval with the existence of our Federal… 100 | ## # ... with 48 more rows 101 | --------------------------------------------------------------------------------