├── .DS_Store ├── .gitignore ├── 00_make_file.R ├── 01_getting_data.Rmd ├── 01_getting_data.html ├── 02_data_cleaning.Rmd ├── 02_data_cleaning.html ├── 03_analysis.Rmd ├── 03_analysis.html ├── 10_paper.Rmd ├── 10_paper.pdf ├── 10_paper_html_paged.Rmd ├── 10_paper_html_paged.html ├── 10_paper_html_paged_files └── paged-0.1.4 │ ├── css │ ├── default-fonts.css │ ├── default-page.css │ └── default.css │ └── js │ ├── config.js │ ├── hooks.js │ └── paged.js ├── 11_poster_professional.Rmd ├── 11_poster_professional.html ├── 11_poster_professional_empty.Rmd ├── 11_poster_professional_empty.html ├── 11_poster_professional_empty_files └── paged-0.1.4 │ └── css │ └── poster-jacobs.css ├── 11_poster_professional_files └── paged-0.1.4 │ └── css │ └── poster-jacobs.css ├── 11_poster_relaxed.Rmd ├── 11_poster_relaxed.html ├── 11_poster_relaxed_empty.Rmd ├── 11_poster_relaxed_empty.html ├── 11_poster_relaxed_empty_files └── paged-0.1.4 │ └── css │ └── poster-relaxed.css ├── 11_poster_relaxed_files └── paged-0.1.4 │ └── css │ └── poster-relaxed.css ├── 12_presentation_slides.Rmd ├── 12_presentation_slides.html ├── 12_presentation_slides_files └── remark-css │ ├── default-fonts.css │ └── default.css ├── README.md ├── data_products ├── models.Rdata └── sotu_texts.Rdata ├── figure ├── unnamed-chunk-3-1.png ├── unnamed-chunk-4-1.png ├── unnamed-chunk-5-1.png ├── unnamed-chunk-7-1.png ├── unnamed-chunk-7-2.png ├── unnamed-chunk-7-3.png └── unnamed-chunk-7-4.png ├── figures ├── num_speeches_per_pres.png ├── sotu_timing_delivery.png └── sotu_timing_model.png ├── from_raw_data_to_paper_and_presentation.Rproj ├── index.bib ├── libs ├── remark-css-0.0.1 │ ├── default-fonts.css │ └── default.css ├── remark-css │ ├── default-fonts.css │ └── default.css └── remark-latest.min.js ├── literature └── bibliography.bib ├── packages.bib ├── raw_data ├── jan_or_feb_state_of_the_union.png ├── transcripts.csv └── trump_2019_cnn.txt └── xaringan-themer.css /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvaMaeRey/from_raw_data_to_paper_and_presentation/2d23d0513dc98488657b560ad4b26271efe76205/.DS_Store -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .Rproj.user 2 | .Rhistory 3 | .RData 4 | .Ruserdata 5 | -------------------------------------------------------------------------------- /00_make_file.R: -------------------------------------------------------------------------------- 1 | # Execute this code to run all source code 2 | rmarkdown::render("01_getting_data.Rmd") 3 | rmarkdown::render("02_data_cleaning.Rmd") 4 | rmarkdown::render("03_analysis.Rmd") 5 | rmarkdown::render("10_paper.Rmd") 6 | rmarkdown::render("11_poster_professional.Rmd") 7 | rmarkdown::render("12_presentation_slides.Rmd") -------------------------------------------------------------------------------- /01_getting_data.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Getting Data" 3 | author: "Evangeline Reynolds" 4 | date: "6/8/2019" 5 | output: html_document 6 | --- 7 | 8 | 9 | I found data of interest put together for us already in Brian Weinstein's github repository. https://github.com/BrianWeinstein/state-of-the-union 10 | 11 | I ended up forking the repository. I want to know that the data won't disappear if he deletes his repository or account. I think forking adresses that. 12 | 13 | https://raw.githubusercontent.com/EvaMaeRey/state-of-the-union/master/transcripts.csv 14 | 15 | Now, we'll do a conditional download. If we've downloaded the csv already, R will skip this step. 16 | 17 | ```{r} 18 | url <- "https://raw.githubusercontent.com/EvaMaeRey/state-of-the-union/master/transcripts.csv" 19 | 20 | if (!file.exists("raw_data/transcripts.csv")) { 21 | download.file(url = url, destfile = "raw_data/transcripts.csv") 22 | } 23 | ``` 24 | 25 | 26 | ```{r} 27 | sessionInfo() 28 | ``` 29 | -------------------------------------------------------------------------------- /02_data_cleaning.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Data Cleaning" 3 | author: "Evangeline Reynolds" 4 | date: "2/2/2019" 5 | output: html_document 6 | --- 7 | 8 | 9 | The 2019 text was copied and pasted into a text document from: 10 | 11 | https://www.cnn.com/2019/02/05/politics/donald-trump-state-of-the-union-2019-transcript/index.html 12 | 13 | ```{r} 14 | library(tidyverse) 15 | trump_2019 <- paste0(readLines("raw_data/trump_2019_cnn.txt"), collapse = "") 16 | 17 | sotu_texts <- read_csv(file = "raw_data/transcripts.csv") %>% 18 | bind_rows(data_frame(date = lubridate::as_date("2019-02-05"), 19 | president = "Donald J. Trump", 20 | transcript = trump_2019)) 21 | 22 | # once 2019 sotu is given, then you can add this one before saving out the object 23 | 24 | save(sotu_texts, file = "data_products/sotu_texts.Rdata") 25 | 26 | ``` 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /03_analysis.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "SOTU analysis" 3 | author: "Evangeline Reynolds" 4 | date: "2/1/2018" 5 | output: html_document 6 | --- 7 | 8 | # Set chunk options 9 | 10 | "Global" options will apply to each code chunk. This chunk option is echo = FALSE, so the code will not print in the compiled document (html). 11 | 12 | ```{r, echo = F} 13 | knitr::opts_chunk$set(message = F, warning = F) 14 | ``` 15 | 16 | 17 | 18 | ```{r} 19 | library(tidyverse) 20 | library(ggrepel) 21 | ``` 22 | 23 | ```{r} 24 | load("data_products/sotu_texts.Rdata") 25 | 26 | sotu_texts <- sotu_texts %>% select(-transcript) 27 | 28 | g0 <- 29 | sotu_texts %>% 30 | group_by(president) %>% 31 | tally() %>% 32 | arrange(n) %>% # piping data into the ggplot 33 | ggplot() + 34 | aes(x = fct_inorder(president), y = n) + 35 | geom_col(fill = "blue", alpha = .3) + 36 | labs(x = "") + 37 | labs(y = "") + 38 | coord_flip() + 39 | labs(title = "Number of State of the Union Adresses") + 40 | labs(subtitle = "Data: Speeches from 1790 to 2018 from www.presidency.ucsb.edu") + 41 | labs(caption = "Vis: @EvaMaeRey\nData Collection: github/BrianWeinstein/state-of-the-union") + 42 | theme_minimal(base_size = 6) 43 | 44 | g0 45 | 46 | ggsave(filename = "figures/num_speeches_per_pres.png", 47 | plot = g0, height = 5, width = 4) 48 | ``` 49 | 50 | 51 | 52 | ```{r} 53 | options(scipen = 10) 54 | 55 | sotu_modified <- sotu_texts %>% 56 | mutate(year = lubridate::year(date)) %>% 57 | mutate(month_day = 58 | lubridate::as_date(str_replace(date, "\\d\\d\\d\\d", "2000"))) %>% 59 | mutate(id = 1:n()) %>% 60 | filter(year > 1934) %>% 61 | mutate(last_name = str_extract(president, "\\w+$")) %>% 62 | mutate(election_year_plus_one = year %in% seq(1933, 2017, by = 4)) %>% 63 | mutate(days_elapsed_since_jan_1 = 64 | date - lubridate::as_date(paste0(year, "-01-01"))) %>% 65 | mutate(days_elapsed_since_jan_1 = as.numeric(days_elapsed_since_jan_1)) 66 | 67 | 68 | g1 <- ggplot(sotu_modified) + 69 | aes(x = year) + 70 | aes(y = month_day) + 71 | aes(label = last_name) + 72 | aes(col = election_year_plus_one) + 73 | # geom_line(col = "steelblue", alpha = .3) + 74 | geom_point(alpha = .7) + 75 | theme_minimal() + 76 | labs(x = "", y = "") + 77 | scale_color_manual(values = c( "steelblue", "grey"), 78 | labels = c( "following", "not following"), 79 | breaks = c(1,0)) + 80 | labs(title = "How late are State of the Union addresses usually delivered? ") + 81 | labs(subtitle = "Data: Speeches from 1934 to 2019 from www.presidency.ucsb.edu") + 82 | labs(caption = "Vis: @EvaMaeRey | Data Collection: github/BrianWeinstein/state-of-the-union") + 83 | labs(color = "SOTU following \nelection year?") + 84 | geom_smooth() + 85 | ggpmisc::stat_dens2d_filter(geom = "text_repel", keep.fraction = 0.25, size = 3.8) 86 | 87 | g1 88 | 89 | ggsave(filename = "figures/sotu_timing_delivery.png", plot = g1, height = 4) 90 | ``` 91 | 92 | 93 | ```{r} 94 | sutu_modified_wo_1973 <- sotu_modified %>% filter(year != 1973) 95 | 96 | 97 | g2 <- ggplot(sotu_modified %>% filter(year != 1973)) + 98 | aes(x = year, y = month_day, label = last_name, 99 | col = election_year_plus_one) + 100 | # geom_line(col = "steelblue", alpha = .3) + 101 | geom_point(alpha = .7) + 102 | theme_minimal() + 103 | labs(x = "", y = "") + 104 | scale_color_manual(values = c( "steelblue", "grey"), 105 | labels = c( "following", "not following"), breaks = c(1,0)) + 106 | labs(title = "How late are State of the Union addresses usually delivered? ") + 107 | labs(subtitle = "Data: Speeches from 1934 to 2018 from www.presidency.ucsb.edu") + 108 | labs(caption = "Vis: @EvaMaeRey | Data Collection: github/BrianWeinstein/state-of-the-union") + 109 | labs(color = "SOTU following \nelection year?") + 110 | geom_smooth(method = "lm") 111 | 112 | g2 113 | 114 | ggsave(file = "figures/sotu_timing_model.png", plot = g2, height = 4) 115 | 116 | ``` 117 | 118 | # Modeling 119 | 120 | ```{r} 121 | 122 | # model 1 123 | lateness_by_year <- 124 | lm(days_elapsed_since_jan_1 ~ year, 125 | data = sutu_modified_wo_1973) 126 | 127 | # model 2 128 | lateness_following_election <- 129 | lm(days_elapsed_since_jan_1 ~ election_year_plus_one, 130 | data = sutu_modified_wo_1973) 131 | 132 | # model 3 133 | lateness_full <- 134 | lm(days_elapsed_since_jan_1 ~ year + election_year_plus_one, 135 | data = sutu_modified_wo_1973) 136 | 137 | # model 3 138 | lateness_full_interaction <- 139 | lm(days_elapsed_since_jan_1 ~ year * election_year_plus_one , 140 | data = sutu_modified_wo_1973) 141 | ``` 142 | 143 | # Model diognostics 144 | 145 | > summary() returns details about the 146 | 147 | ```{r} 148 | summary(lateness_full_interaction) 149 | # some diognostics 150 | plot(lateness_full_interaction) 151 | ``` 152 | 153 | 154 | 155 | 156 | ```{r, results='asis'} 157 | stargazer::stargazer(lateness_by_year, lateness_following_election, 158 | lateness_full, lateness_full_interaction, 159 | type = "html", 160 | style = "qje") 161 | 162 | save(lateness_by_year, lateness_following_election, 163 | lateness_full, lateness_full_interaction, 164 | file = "data_products/models.Rdata") 165 | 166 | ``` 167 | 168 | ```{r} 169 | sessionInfo() 170 | ``` 171 | 172 | -------------------------------------------------------------------------------- /10_paper.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "State of the Union Addresses" 3 | author: "Gina Reynolds, Susie Q., Johny J." 4 | date: "2/2/2019" 5 | output: 6 | bookdown::pdf_document2: 7 | toc: yes 8 | bibliography: literature/bibliography.bib 9 | --- 10 | 11 | 12 | 13 | 14 | ```{r, echo=FALSE} 15 | knitr::opts_chunk$set(echo = F, warning = F, message = F) 16 | ``` 17 | 18 | 19 | 20 | # Abstract 21 | 22 | State of the Union addresses are a classic corpus for students of text analysis. To the author's knowledge, less has been done to characterize the timing of addresses.[^0] In this paper you'll see time-in-year by year plots and a model of the timing. 23 | 24 | [^0]: Motivation for addressing this question actually comes from Kenneth Benoit who conducted a quick [analysis](https://twitter.com/kenbenoit/status/1088304778088566785) on this question. 25 | 26 | 27 | # Introduction 28 | 29 | The 2019 government shutdown had many people wondering, when will US State of the Union address be delivered by the President. Will it be pushed later than what is considered "normal".[^1] I might have another tangential comment.[^2] 30 | 31 | [^1]: Here is my tangential comment (footnote). It will appear at the end of the page or bottom of the document. 32 | 33 | [^2]: Here is a second tangential point. 34 | 35 | # Literature Review 36 | 37 | The texts of the State of the Union addresses have been studied by scholars including Benoit, Munger and Spirling [-@benoit2018measuring]; they offer an interesting analysis of State of the Union addresses by US presidents, noting that SOTU that are not delivered orally tend to use more complex language. There are several R text analysis packages [@silge2016tidytext; @benoit2016quanteda]. These entries are included in the literature/bibliography.bib document that is referenced in the YMAL. 38 | 39 | > In this section you might write quota a large selection which you will want to indent. 40 | 41 | 42 | # Theory and Hypotheses 43 | 44 | This analysis was exploratory. It is well known that modern SOTU addresses are delivered early in the year. After plotting the data, what seemed to matter was year of delivery, and if the SOTU followed an election year. We tried to follow the advice in the e-book [The Fundamentals of Data Visualization](https://serialmentor.com/dataviz). 45 | 46 | The principles in TFODV are listed in Table \@ref(tab:goodbadugly) 47 | 48 | Category | Description 49 | -----|------ 50 | Bad | Misrepresents data or confuse 51 | Ugly | Not pleasing 52 | Good | Not bad and not ugly 53 | 54 | Table: (#tab:goodbadugly) This is the caption for the table about data visualization categories from *"The Fundamentals of Data Visualization."* 55 | 56 | 57 | 58 | # Data 59 | 60 | 61 | The corpus data was made available by on github. 62 | President in general give one SOTU address per year they serve as president but there are some exceptions as seen in table \@ref(tab:nice-tab) 63 | 64 | 65 | ```{r nice-tab} 66 | library(tidyverse) 67 | # load cleaned data 68 | load("data_products/sotu_texts.Rdata") 69 | sotu_texts_mod <- sotu_texts %>% 70 | mutate(president = fct_inorder(president)) %>% 71 | group_by(president) %>% tally() %>% 72 | rename(President = president) %>% 73 | rename(`Number of Addresses` = n) 74 | 75 | knitr::kable(sotu_texts_mod %>% head(14), caption = "This table contains presidents and the number of SOTU that they have given") 76 | ``` 77 | 78 | 79 | # Analysis 80 | 81 | ## Visualization of relationships 82 | 83 | Here I show some of the relationships in the data visually: 84 | 85 | ```{r year, fig.cap = "Timing of state of the union by year. SOTUs that follow election years are colored with blue.", out.width='\\textwidth', fig.align='center'} 86 | knitr::include_graphics("figures/sotu_timing_delivery.png") 87 | ``` 88 | 89 | In figure \@ref(fig:year) we use LOESS smoothing to summarize the relationship between year and time in year for the categories "following election year" and "not following". In the linear modelling exercise below, we remove the 1973 cases, given that they are so unusual --- in light of the Nixon impeachment, there were multiple SOTU's delivered that year. 90 | 91 | 92 | ## Modeling 93 | 94 | 95 | 96 | 97 | We load the models that we've estimated and save out,then prepare the table using stargazer. 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | If compiling to pdf: in the ymal you will change: bookdown::pdf_document2. Note that setting the label is done differently than the knit to html version. 116 | 117 | ```{r regtable_pdf, results = "asis"} 118 | load("data_products/models.Rdata") 119 | stargazer::stargazer(lateness_by_year, 120 | lateness_following_election, lateness_full_interaction, 121 | dep.var.labels = "Days elapsed since January 1st", 122 | covariate.labels = c("year", "post election", "year*post election"), 123 | type = "latex", font.size = "small", 124 | title = "Models of time elapsed in year before state of the union address", 125 | header = FALSE, 126 | label = "tab:regtable" 127 | ) 128 | # Todo figure out how to get stargazer message not to show 129 | ``` 130 | 131 | 132 | 133 | As you can see in the regression table \@ref(tab:regtable), the R^2 for the full model with an interaction term is `r round(summary(lateness_full_interaction)$r.squared, 3)`. 134 | 135 | 136 | The full model formula with the interaction is: 137 | 138 | 139 | $$ DaysSinceJan1 = \beta_0 + \beta_1Year + B_2FollowingElection + B_3Year*FollowingElection + \epsilon $$ 140 | 141 | ```{r, fig.cap = "Timing of state of the union by year. SOTUs that follow election years are colored with blue.", out.width='\\textwidth', fig.align='center'} 142 | # Include the figure that you have saved out in working files 143 | knitr::include_graphics("figures/sotu_timing_model.png") 144 | ``` 145 | 146 | 147 | 148 | Need to put figures side-by-side? Use fig.show = hold in the code chunk options, and specify the width 149 | 150 | 151 | ```{r, fig.cap = "Timing of state of the union by year. SOTUs that follow election years are colored with blue.", out.width='45%', fig.align='center', fig.show= "hold"} 152 | # Include the figure that you have saved out in working files 153 | knitr::include_graphics(c("figures/sotu_timing_delivery.png", "figures/sotu_timing_model.png")) 154 | ``` 155 | 156 | 157 | 158 | 159 | Note that the visualization of the linear models do not represent the full model with the interaction but rather independent models for each category "following", "not following", the default for ggplot2. Not going to worry about this. 160 | 161 | 162 | # Conclusion 163 | 164 | 165 | The analysis shows the timing of State of the Union addresses is increasingly late in the year and is dependent on whether it follows an election year. While the 2019 State of the Union address is in February, which is unusual for a large departure from the trend. In future work, we might look at plotting prediction intervals as well as confidence intervals Now is a good time to spell check (Edit -> Spell Check...)! 166 | 167 | 168 | # References 169 | 170 | 171 | 172 | 173 | -------------------------------------------------------------------------------- /10_paper.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvaMaeRey/from_raw_data_to_paper_and_presentation/2d23d0513dc98488657b560ad4b26271efe76205/10_paper.pdf -------------------------------------------------------------------------------- /10_paper_html_paged.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Timing of State of the Union Addresses" 3 | author: "Gina Reynolds" 4 | date: "`r Sys.Date()`" 5 | output: 6 | pagedown::html_paged: 7 | toc: true 8 | # change to true for a self-contained document, but it'll be a litte slower for Pandoc to render 9 | self_contained: false 10 | --- 11 | 12 | ```{r setup, include=FALSE} 13 | knitr::opts_chunk$set(echo = TRUE) 14 | ``` 15 | 16 | 17 | # Abstract 18 | 19 | State of the Union addresses are a classic corpus for students of text analysis. To the author's knowledge, less has been done to characterize the timing of addresses.[^0] In this paper you'll see time-in-year by year plots and a model of the timing. 20 | 21 | [^0]: Motivation for addressing this question actually comes from Kenneth Benoit who conducted a quick [analysis](https://twitter.com/kenbenoit/status/1088304778088566785) on this question. 22 | 23 | 24 | # Introduction 25 | 26 | The 2019 government shutdown had many people wondering, when will US State of the Union address be delivered by the President. Will it be pushed later than what is considered "normal".[^1] I might have another tangential comment.[^2] 27 | 28 | [^1]: Here is my tangential comment (footnote). It will appear at the end of the page or bottom of the document. 29 | 30 | [^2]: Here is a second tangential point. 31 | 32 | # Literature Review 33 | 34 | The texts of the State of the Union addresses have been studied by scholars including Benoit, Munger and Spirling [-@benoit2018measuring]; they offer an interesting analysis of State of the Union addresses by US presidents, noting that SOTU that are not delivered orally tend to use more complex language. There are several R text analysis packages [@silge2016tidytext; @benoit2016quanteda]. These entries are included in the literature/bibliography.bib document that is referenced in the YMAL. 35 | 36 | > In this section you might write quota a large selection which you will want to indent. 37 | 38 | 39 | # Theory and Hypotheses 40 | 41 | This analysis was exploratory. It is well known that modern SOTU addresses are delivered early in the year. After plotting the data, what seemed to matter was year of delivery, and if the SOTU followed an election year. We tried to follow the advice in the e-book [The Fundamentals of Data Visualization](https://serialmentor.com/dataviz). 42 | 43 | The principles in TFODV are listed in Table \@ref(fig:goodbadugly) 44 | 45 | Category | Description 46 | -----|------ 47 | Bad | Misrepresents data or confuse 48 | Ugly | Not pleasing 49 | Good | Not bad and not ugly 50 | 51 | Table: This is the caption for the table about data visualization categories from *"The Fundamentals of Data Visualization."* 52 | 53 | 54 | 55 | # Data 56 | 57 | 58 | The corpus data was made available by on github. 59 | President in general give one SOTU address per year they serve as president but there are some exceptions as seen in table \@ref(tab:nice-tab) 60 | 61 | 62 | ```{r nice-tab} 63 | library(tidyverse) 64 | # load cleaned data 65 | load("data_products/sotu_texts.Rdata") 66 | sotu_texts_mod <- sotu_texts %>% 67 | mutate(president = fct_inorder(president)) %>% 68 | group_by(president) %>% tally() %>% 69 | rename(President = president) %>% 70 | rename(`Number of Addresses` = n) 71 | 72 | knitr::kable(sotu_texts_mod %>% head(14), caption = "This table contains presidents and the number of SOTU that they have given") 73 | ``` 74 | 75 | 76 | # Analysis 77 | 78 | ## Visual explorations of relationships 79 | 80 | Here I show some of the relationships in the data visually: 81 | 82 | ```{r year, fig.cap = "Timing of state of the union by year. SOTUs that follow election years are colored with blue.", out.width='\\textwidth', fig.align='center'} 83 | # Include the figure that you have saved out in working files 84 | knitr::include_graphics("figures/sotu_timing_delivery.png") 85 | ``` 86 | 87 | 88 | In figure \@ref(fig:year) blah blah blah. 89 | 90 | 91 | ## Modeling 92 | 93 | 94 | 95 | 96 | ```{r regtable, results = "asis"} 97 | # load models that have been saved in .Rdata file previously 98 | load("data_products/models.Rdata") 99 | stargazer::stargazer(lateness_by_year, 100 | lateness_following_election, lateness_full, lateness_full_interaction, 101 | dep.var.labels = "Days elapsed since January 1st", 102 | covariate.labels = c("year", "post election", "year*post election"), 103 | title = "The table title", 104 | style = "qje", 105 | type = "html") 106 | ``` 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | As you can see in the regression table \@ref(tab:regtable)... 129 | 130 | The R^2 for the full model is `r round(summary(lateness_full_interaction)$r.squared, 3)`. 131 | 132 | 133 | The full model formula with the interaction is: 134 | 135 | $$ DaysSinceJan1 = \beta_0 + \beta_1YEAR + B_2FollowingElection + B_3Year*FollowingElection + \epsilon $$ 136 | 137 | ```{r, fig.cap = "Timing of state of the union by year. SOTUs that follow election years are colored with blue.", out.width='\\textwidth', fig.align='center'} 138 | # Include the figure that you have saved out in working files 139 | knitr::include_graphics("figures/sotu_timing_model.png") 140 | ``` 141 | 142 | 143 | 144 | 145 | 146 | # Conclusion 147 | 148 | 149 | Here are some conclusions. Now is a good time to spell check. 150 | 151 | 152 | # References 153 | 154 | -------------------------------------------------------------------------------- /10_paper_html_paged.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | Timing of State of the Union Addresses 23 | 24 | 25 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 |
128 | 129 |
130 | 131 | 132 | 133 |
134 | 139 |
140 | 141 |
142 |
143 | 156 |
157 |
158 | 159 |
160 |

1 Abstract

161 |

State of the Union addresses are a classic corpus for students of text analysis. To the author’s knowledge, less has been done to characterize the timing of addresses.1 In this paper you’ll see time-in-year by year plots and a model of the timing.

162 |
163 |
164 |

2 Introduction

165 |

The 2019 government shutdown had many people wondering, when will US State of the Union address be delivered by the President. Will it be pushed later than what is considered “normal”.2 I might have another tangential comment.3

166 |
167 |
168 |

3 Literature Review

169 |

The texts of the State of the Union addresses have been studied by scholars including Benoit, Munger and Spirling [-@benoit2018measuring]; they offer an interesting analysis of State of the Union addresses by US presidents, noting that SOTU that are not delivered orally tend to use more complex language. There are several R text analysis packages [@silge2016tidytext; @benoit2016quanteda]. These entries are included in the literature/bibliography.bib document that is referenced in the YMAL.

170 |
171 |

In this section you might write quota a large selection which you will want to indent.

172 |
173 |
174 |
175 |

4 Theory and Hypotheses

176 |

This analysis was exploratory. It is well known that modern SOTU addresses are delivered early in the year. After plotting the data, what seemed to matter was year of delivery, and if the SOTU followed an election year. We tried to follow the advice in the e-book The Fundamentals of Data Visualization.

177 |

The principles in TFODV are listed in Table ??

178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 |
This is the caption for the table about data visualization categories from “The Fundamentals of Data Visualization.”
CategoryDescription
BadMisrepresents data or confuse
UglyNot pleasing
GoodNot bad and not ugly
201 |
202 |
203 |

5 Data

204 |

The corpus data was made available by on github.
205 | President in general give one SOTU address per year they serve as president but there are some exceptions as seen in table 5.1

206 |
library(tidyverse)
207 |
## ── Attaching packages ───────────────────────────────────────────────────────────────────────────────────────────────────── tidyverse 1.2.1 ──
208 |
## ✔ ggplot2 3.1.1     ✔ purrr   0.3.0
209 | ## ✔ tibble  2.1.1     ✔ dplyr   0.7.8
210 | ## ✔ tidyr   0.8.2     ✔ stringr 1.4.0
211 | ## ✔ readr   1.1.1     ✔ forcats 0.3.0
212 |
## Warning: package 'ggplot2' was built under R version 3.5.2
213 |
## Warning: package 'tibble' was built under R version 3.5.2
214 |
## Warning: package 'purrr' was built under R version 3.5.2
215 |
## Warning: package 'stringr' was built under R version 3.5.2
216 |
## ── Conflicts ──────────────────────────────────────────────────────────────────────────────────────────────────────── tidyverse_conflicts() ──
217 | ## ✖ dplyr::filter() masks stats::filter()
218 | ## ✖ dplyr::lag()    masks stats::lag()
219 |
# load cleaned data
220 | load("data_products/sotu_texts.Rdata")
221 | sotu_texts_mod <- sotu_texts %>% 
222 |   mutate(president = fct_inorder(president)) %>% 
223 |   group_by(president) %>% tally() %>% 
224 |   rename(President = president) %>% 
225 |   rename(`Number of Addresses` = n) 
226 | 
227 | knitr::kable(sotu_texts_mod %>% head(14), caption = "This table contains presidents and the number of SOTU that they have given")
228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 |
Table 5.1: This table contains presidents and the number of SOTU that they have given
PresidentNumber of Addresses
Donald J. Trump3
Barack Obama8
George W. Bush8
William J. Clinton8
George Bush4
Ronald Reagan8
Jimmy Carter7
Gerald R. Ford3
Richard Nixon12
Lyndon B. Johnson6
John F. Kennedy3
Dwight D. Eisenhower10
Harry S. Truman8
Franklin D. Roosevelt13
295 |
296 |
297 |

6 Analysis

298 |
299 |

6.1 Visual explorations of relationships

300 |

Here I show some of the relationships in the data visually:

301 |
# Include the figure that you have saved out in working files
302 | knitr::include_graphics("figures/sotu_timing_delivery.png")
303 |
304 | Timing of state of the union by year.  SOTUs that follow election years are colored with blue. 305 |

306 | Figure 6.1: Timing of state of the union by year. SOTUs that follow election years are colored with blue. 307 |

308 |
309 |

In figure 6.1 blah blah blah.

310 |
311 |
312 |

6.2 Modeling

313 | 314 |
# load models that have been saved in .Rdata file previously
315 | load("data_products/models.Rdata")
316 | stargazer::stargazer(lateness_by_year,
317 |                      lateness_following_election, lateness_full, lateness_full_interaction,
318 |                      dep.var.labels = "Days elapsed since January 1st",
319 |                      covariate.labels = c("year", "post election", "year*post election"),
320 |                      title = "The table title",
321 |                      style = "qje",
322 |                      type = "html")
323 | 324 | 327 | 328 | 330 | 331 | 332 | 334 | 337 | 338 | 339 | 341 | 344 | 347 | 350 | 353 | 354 | 355 | 357 | 358 | 359 | 362 | 365 | 367 | 370 | 373 | 374 | 375 | 377 | 380 | 382 | 385 | 388 | 389 | 390 | 392 | 394 | 396 | 398 | 400 | 401 | 402 | 405 | 407 | 410 | 413 | 416 | 417 | 418 | 420 | 422 | 425 | 428 | 431 | 432 | 433 | 435 | 437 | 439 | 441 | 443 | 444 | 445 | 448 | 450 | 452 | 454 | 457 | 458 | 459 | 461 | 463 | 465 | 467 | 470 | 471 | 472 | 474 | 476 | 478 | 480 | 482 | 483 | 484 | 487 | 490 | 493 | 496 | 499 | 500 | 501 | 503 | 506 | 509 | 512 | 515 | 516 | 517 | 519 | 521 | 523 | 525 | 527 | 528 | 529 | 532 | 535 | 538 | 541 | 544 | 545 | 546 | 549 | 552 | 555 | 558 | 561 | 562 | 563 | 566 | 569 | 572 | 575 | 578 | 579 | 580 | 583 | 586 | 589 | 592 | 595 | 596 | 597 | 600 | 603 | 606 | 609 | 612 | 613 | 614 | 616 | 617 | 618 | 621 | 624 | 625 | 626 | 628 | 631 | 632 | 633 | 635 | 638 | 639 |
325 | The table title 326 |
329 |
333 | 335 | Days elapsed since January 1st 336 |
340 | 342 | (1) 343 | 345 | (2) 346 | 348 | (3) 349 | 351 | (4) 352 |
356 |
360 | year 361 | 363 | 0.401*** 364 | 366 | 368 | 0.408*** 369 | 371 | 0.320*** 372 |
376 | 378 | (0.038) 379 | 381 | 383 | (0.035) 384 | 386 | (0.036) 387 |
391 | 393 | 395 | 397 | 399 |
403 | post election 404 | 406 | 408 | 7.700** 409 | 411 | 8.654*** 412 | 414 | -653.628*** 415 |
419 | 421 | 423 | (2.991) 424 | 426 | (1.894) 427 | 429 | (139.861) 430 |
434 | 436 | 438 | 440 | 442 |
446 | year*post election 447 | 449 | 451 | 453 | 455 | 0.335*** 456 |
460 | 462 | 464 | 466 | 468 | (0.071) 469 |
473 | 475 | 477 | 479 | 481 |
485 | Constant 486 | 488 | -773.950*** 489 | 491 | 17.300*** 492 | 494 | -789.534*** 495 | 497 | -615.478*** 498 |
502 | 504 | (75.412) 505 | 507 | (1.511) 508 | 510 | (68.468) 511 | 513 | (71.731) 514 |
518 | 520 | 522 | 524 | 526 |
530 | N 531 | 533 | 94 534 | 536 | 94 537 | 539 | 94 540 | 542 | 94 543 |
547 | R2 548 | 550 | 0.546 551 | 553 | 0.067 554 | 556 | 0.631 557 | 559 | 0.704 560 |
564 | Adjusted R2 565 | 567 | 0.541 568 | 570 | 0.057 571 | 573 | 0.623 574 | 576 | 0.695 577 |
581 | Residual Std. Error 582 | 584 | 8.821 (df = 92) 585 | 587 | 12.644 (df = 92) 588 | 590 | 7.999 (df = 91) 591 | 593 | 7.196 (df = 90) 594 |
598 | F Statistic 599 | 601 | 110.654*** (df = 1; 92) 602 | 604 | 6.628** (df = 1; 92) 605 | 607 | 77.726*** (df = 2; 91) 608 | 610 | 71.493*** (df = 3; 90) 611 |
615 |
619 | Notes: 620 | 622 | ***Significant at the 1 percent level. 623 |
627 | 629 | **Significant at the 5 percent level. 630 |
634 | 636 | *Significant at the 10 percent level. 637 |
640 | 641 | 642 | 643 | 644 | 645 | 646 | 647 | 648 | 649 | 650 | 651 | 652 | 653 | 654 |

As you can see in the regression table ??

655 |

The R^2 for the full model is 0.704.

656 |

The full model formula with the interaction is:

657 |

\[ DaysSinceJan1 = \beta_0 + \beta_1YEAR + B_2FollowingElection + B_3Year*FollowingElection + \epsilon \]

658 |
# Include the figure that you have saved out in working files
659 | knitr::include_graphics("figures/sotu_timing_model.png")
660 |
661 | Timing of state of the union by year.  SOTUs that follow election years are colored with blue. 662 |

663 | Figure 6.2: Timing of state of the union by year. SOTUs that follow election years are colored with blue. 664 |

665 |
666 |
667 |
668 |
669 |

7 Conclusion

670 |

Here are some conclusions. Now is a good time to spell check.

671 |
672 |
673 |

8 References

674 | 675 |
676 |
677 |
678 |
    679 |
  1. Motivation for addressing this question actually comes from Kenneth Benoit who conducted a quick analysis on this question.

  2. 680 |
  3. Here is my tangential comment (footnote). It will appear at the end of the page or bottom of the document.

  4. 681 |
  5. Here is a second tangential point.

  6. 682 |
683 |
684 | 685 | 686 | 687 | 693 | 694 | 695 | -------------------------------------------------------------------------------- /10_paper_html_paged_files/paged-0.1.4/css/default-fonts.css: -------------------------------------------------------------------------------- 1 | @import 'https://fonts.googleapis.com/css?family=Old+Standard+TT'; 2 | 3 | body { 4 | font-family: 'Old Standard TT', Palatino, "Palatino Linotype", "Palatino LT STD", Georgia, 'source-han-serif-sc', 'Source Han Serif SC', 'Source Han Serif CN', 'Source Han Serif TC', 'Source Han Serif TW', 'Source Han Serif', 'Songti SC', 'Microsoft YaHei', serif; 5 | } 6 | blockquote { 7 | font-family: 'Old Standard TT', Palatino, "Palatino Linotype", "Palatino LT STD", Georgia, 'STKaiti', 'KaiTi', '楷体', 'SimKai', 'DFKai-SB', 'NSimSun', serif; 8 | } 9 | code { 10 | font-family: Consolas, Courier, "Courier New", 'STKaiti', 'KaiTi', 'SimKai', monospace; 11 | } 12 | pre, code { 13 | font-size: .95em; 14 | } 15 | -------------------------------------------------------------------------------- /10_paper_html_paged_files/paged-0.1.4/css/default-page.css: -------------------------------------------------------------------------------- 1 | /* page size */ 2 | @page { 3 | size: 6in 9in; /* var(--width) doesn't work in browser when printing */ 4 | } 5 | @page :blank { 6 | 7 | } 8 | 9 | /* store some string variables */ 10 | .shorttitle1 { 11 | string-set: h1-text content(text); 12 | } 13 | 14 | .shorttitle2 { 15 | string-set: h2-text content(text); 16 | } 17 | 18 | /* left page */ 19 | .running-h1-title { 20 | position: running(runningH1Title); 21 | width: var(--running-title-width); 22 | text-overflow: ellipsis; 23 | overflow: hidden; 24 | } 25 | .running-h1-title:before { 26 | content: string(h1-text); 27 | } 28 | 29 | @page chapter:left { 30 | @top-left { 31 | content: counter(page); 32 | } 33 | @top-right { 34 | content: element(runningH1Title); 35 | white-space: nowrap !important; 36 | } 37 | } 38 | 39 | /* right page */ 40 | .running-h2-title { 41 | position: running(runningH2Title); 42 | width: var(--running-title-width); 43 | text-overflow: ellipsis; 44 | overflow: hidden; 45 | } 46 | .running-h2-title:before { 47 | /* We would want to write: */ 48 | /* content: string(h2-text, start); */ 49 | /* However, this is yet unsupported by Paged.js, see https://gitlab.pagedmedia.org/tools/pagedjs/issues/38 */ 50 | content: string(h2-text); 51 | } 52 | @page chapter:right { 53 | @top-right { 54 | content: counter(page); 55 | } 56 | @top-left { 57 | content: element(runningH2Title); 58 | white-space: nowrap !important; 59 | } 60 | } 61 | 62 | /* New chapter page */ 63 | @page chapter:first { 64 | @top-left { 65 | content: none; 66 | } 67 | @top-right { 68 | content: none; 69 | } 70 | @bottom-right { 71 | content: counter(page); 72 | } 73 | } 74 | @page :first { 75 | @top-left { 76 | content: none; 77 | } 78 | @top-right { 79 | content: none; 80 | } 81 | @bottom-right { 82 | content: none !important; 83 | } 84 | } 85 | 86 | /* Front matter*/ 87 | @page frontmatter:left { 88 | @top-left { 89 | content: counter(page, lower-roman); 90 | } 91 | @top-right { 92 | content: element(runningH1Title); 93 | white-space: nowrap !important; 94 | } 95 | } 96 | @page frontmatter:right { 97 | @top-right { 98 | content: counter(page, lower-roman); 99 | } 100 | @top-left { 101 | content: element(runningH1Title); 102 | white-space: nowrap !important; 103 | } 104 | } 105 | @page frontmatter:first { 106 | @top-left { 107 | content: none; 108 | } 109 | @top-right { 110 | content: none; 111 | } 112 | @bottom-right { 113 | content: counter(page, lower-roman); 114 | } 115 | } 116 | 117 | /* page breaks; aka CSS fragmentation */ 118 | .level1 { 119 | break-before: recto; 120 | page: chapter; 121 | } 122 | .front-matter-container .level1 { 123 | page: frontmatter; 124 | } 125 | h1, h2, h3, h4, h5, h6 { 126 | break-after: avoid; 127 | } 128 | .footenotes { 129 | break-before: always; 130 | break-after: always; 131 | } 132 | .figure { 133 | break-inside: avoid; 134 | } 135 | 136 | /* reset page numbering after front matter */ 137 | .front-matter-container+.level1 h1 { 138 | counter-reset: page; 139 | } 140 | -------------------------------------------------------------------------------- /10_paper_html_paged_files/paged-0.1.4/css/default.css: -------------------------------------------------------------------------------- 1 | :root { 2 | --background: whitesmoke; 3 | --width: 6in; 4 | --height: 9in; 5 | --color-paper: white; 6 | --color-mbox: rgba(0, 0, 0, 0.2); 7 | --running-title-width: 2.5in; 8 | --screen-pages-spacing: 5mm; 9 | } 10 | 11 | /* generated content */ 12 | a[href^="http"]:not([class="uri"])::after { 13 | content: " (" attr(href) ")"; 14 | font-size: 90%; 15 | hyphens: none; 16 | word-break: break-all; 17 | } 18 | .references a[href^=http]:not([class=uri])::after { 19 | content: none; 20 | } 21 | .main a[href^="#"]:not([class^="footnote-"]):not([href*=":"])::after { 22 | content: " (page " target-counter(attr(href), page) ")"; 23 | } 24 | .main a.front-matter-ref[href^="#"]:not([class^="footnote-"]):not([href*=":"])::after { 25 | content: " (page " target-counter(attr(href), page, lower-roman) ")"; 26 | } 27 | 28 | /* TOC, LOT, LOF */ 29 | .toc ul, .lot ul, .lof ul { 30 | list-style: none; 31 | padding-left: 0; 32 | overflow-x: hidden; 33 | } 34 | .toc li li { 35 | padding-left: 1em; 36 | } 37 | .toc a, .lot a, .lof a { 38 | text-decoration: none; 39 | background: white; 40 | padding-right: .33em; 41 | } 42 | .toc a::after, .lot a::after, .lof a::after { 43 | /* content: leader(dotted) target-counter(attr(href), page); */ 44 | content: target-counter(attr(href), page); 45 | float: right; 46 | background: white; 47 | } 48 | .toc a.front-matter-ref::after, .lot a.front-matter-ref::after, .lof a.front-matter-ref::after { 49 | /* content: leader(dotted) target-counter(attr(href), page, lower-roman); */ 50 | content: target-counter(attr(href), page, lower-roman); 51 | } 52 | .toc .leaders::before, .lot .leaders::before, .lof .leaders::before { 53 | float: left; 54 | width: 0; 55 | white-space: nowrap; 56 | content: ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . "; 57 | } 58 | 59 | /* misc elements */ 60 | .subtitle span { 61 | font-size: .9em; 62 | } 63 | img { 64 | max-width: 100%; 65 | } 66 | pre { 67 | padding: 1em; 68 | } 69 | pre[class] { 70 | background: #f9f9f9; 71 | } 72 | table { 73 | margin: auto; 74 | border-top: 1px solid #666; 75 | border-bottom: 1px solid #666; 76 | } 77 | table thead th { 78 | border-bottom: 1px solid #ddd; 79 | } 80 | thead, tfoot, tr:nth-child(even) { 81 | background: #eee; 82 | } 83 | .footnotes { 84 | font-size: 90%; 85 | } 86 | .footnotes hr::before { 87 | content: "Footnotes:"; 88 | } 89 | .footnotes hr { 90 | border: none; 91 | } 92 | .footnote-break { 93 | width: 1in; 94 | } 95 | body { 96 | hyphens: auto; 97 | } 98 | code { 99 | hyphens: none; 100 | } 101 | 102 | /* two pages in a row if possible on screen */ 103 | @media screen { 104 | body { 105 | background-color: var(--background); 106 | margin: var(--screen-pages-spacing) auto 0 auto; 107 | } 108 | .pagedjs_pages { 109 | display: flex; 110 | max-width: calc(var(--width) * 2); 111 | flex: 0; 112 | flex-wrap: wrap; 113 | margin: 0 auto; 114 | } 115 | .pagedjs_page { 116 | background: var(--color-paper); 117 | box-shadow: 0 0 0 1px var(--color-mbox); 118 | flex-shrink: 0; 119 | flex-grow: 0; 120 | margin: auto auto var(--screen-pages-spacing) auto; 121 | } 122 | } 123 | 124 | /* when a row can hold two pages, start first page on the right */ 125 | @media (min-width: 12.32in) { 126 | .pagedjs_page { 127 | margin: auto 0 var(--screen-pages-spacing) 0; 128 | } 129 | .pagedjs_first_page { 130 | margin-left: var(--width); 131 | } 132 | } 133 | 134 | /* use a fixed width body for mobiles */ 135 | @media screen and (max-width:1180px) { 136 | body { 137 | width: calc(var(--width) + 2 * var(--screen-pages-spacing)); 138 | } 139 | } 140 | -------------------------------------------------------------------------------- /10_paper_html_paged_files/paged-0.1.4/js/config.js: -------------------------------------------------------------------------------- 1 | // Configuration script for paged.js 2 | 3 | (function() { 4 | // Retrieve MathJax loading function 5 | function getBeforeAsync() { 6 | if (typeof window.PagedConfig !== "undefined") { 7 | if (typeof window.PagedConfig.before !== "undefined") { 8 | return window.PagedConfig.before; 9 | } 10 | } 11 | return async () => {}; 12 | } 13 | 14 | var runMathJax = getBeforeAsync(); 15 | 16 | // This function puts the sections of class front-matter in the div.front-matter-container 17 | async function moveToFrontMatter() { 18 | let frontMatter = document.querySelector('.front-matter-container'); 19 | const items = document.querySelectorAll('.level1.front-matter'); 20 | for (const item of items) { 21 | frontMatter.appendChild(item); 22 | } 23 | } 24 | 25 | // This function adds the class front-matter-ref to any element 26 | // referring to an entry in the front matter 27 | async function detectFrontMatterReferences() { 28 | const frontMatter = document.querySelector('.front-matter-container'); 29 | if (!frontMatter) return; 30 | let anchors = document.querySelectorAll('a[href^="#"]:not([href*=":"])'); 31 | for (let a of anchors) { 32 | const ref = a.getAttribute('href'); 33 | const element = document.querySelector(ref); 34 | if (frontMatter.contains(element)) a.classList.add('front-matter-ref'); 35 | } 36 | } 37 | 38 | // This function expands the links in the lists of figures or tables (loft) 39 | async function expandLinksInLoft() { 40 | var items = document.querySelectorAll('.lof li, .lot li'); 41 | for (var item of items) { 42 | var anchor = item.firstChild; 43 | anchor.innerText = item.innerText; 44 | item.innerText = ''; 45 | item.append(anchor); 46 | } 47 | } 48 | 49 | // This function add spans for leading symbols. 50 | async function addLeadersSpans() { 51 | var anchors = document.querySelectorAll('.toc a, .lof a, .lot a'); 52 | for (var a of anchors) { 53 | a.innerHTML = a.innerHTML + ''; 54 | } 55 | } 56 | 57 | /* A factory returning a function that appends short titles spans. 58 | The text content of these spans are reused for running titles (see default.css). 59 | Argument: level - An integer between 1 and 6. 60 | */ 61 | function appendShortTitleSpans(level) { 62 | return async () => { 63 | var divs = Array.from(document.getElementsByClassName('level' + level)); 64 | 65 | async function addSpan(div) { 66 | var mainHeader = div.getElementsByTagName('h' + level)[0]; 67 | if (!mainHeader) return; 68 | var mainTitle = mainHeader.textContent; 69 | var spanSectionNumber = mainHeader.getElementsByClassName('header-section-number')[0]; 70 | var mainNumber = !!spanSectionNumber ? spanSectionNumber.textContent : ''; 71 | var runningTitle = 'shortTitle' in div.dataset ? mainNumber + ' ' + div.dataset.shortTitle : mainTitle; 72 | var span = document.createElement('span'); 73 | span.className = 'shorttitle' + level; 74 | span.innerText = runningTitle; 75 | span.style.display = "none"; 76 | mainHeader.insertAdjacentElement('afterend', span); 77 | if (level == 1 && div.querySelector('.level2') === null) { 78 | var span2 = document.createElement('span'); 79 | span2.className = 'shorttitle2'; 80 | span2.innerText = ' '; 81 | span2.style.display = "none"; 82 | span.insertAdjacentElement('afterend', span2); 83 | } 84 | } 85 | 86 | for (const div of divs) { 87 | await addSpan(div); 88 | } 89 | }; 90 | } 91 | 92 | var appendShortTitles1 = appendShortTitleSpans(1); 93 | var appendShortTitles2 = appendShortTitleSpans(2); 94 | 95 | window.PagedConfig = { 96 | before: async () => { 97 | await moveToFrontMatter(); 98 | await detectFrontMatterReferences(); 99 | await expandLinksInLoft(); 100 | await Promise.all([ 101 | addLeadersSpans(), 102 | appendShortTitles1(), 103 | appendShortTitles2() 104 | ]); 105 | await runMathJax(); 106 | }, 107 | after: () => { 108 | // pagedownListener is a binder added by the chrome_print function 109 | // this binder exists only when chrome_print opens the html file 110 | if (window.pagedownListener) { 111 | // the html file is opened for printing 112 | // call the binder to signal to the R session that Paged.js has finished 113 | pagedownListener(''); 114 | } else { 115 | // scroll to the last position before the page is reloaded 116 | window.scrollTo(0, sessionStorage.getItem('pagedown-scroll')); 117 | } 118 | } 119 | }; 120 | })(); 121 | -------------------------------------------------------------------------------- /10_paper_html_paged_files/paged-0.1.4/js/hooks.js: -------------------------------------------------------------------------------- 1 | // Hooks for paged.js 2 | 3 | // Footnotes support 4 | Paged.registerHandlers(class extends Paged.Handler { 5 | constructor(chunker, polisher, caller) { 6 | super(chunker, polisher, caller); 7 | 8 | this.splittedParagraphRefs = []; 9 | } 10 | 11 | beforeParsed(content) { 12 | var footnotes = content.querySelectorAll('.footnote'); 13 | 14 | for (var footnote of footnotes) { 15 | var parentElement = footnote.parentElement; 16 | var footnoteCall = document.createElement('a'); 17 | var footnoteNumber = footnote.dataset.pagedownFootnoteNumber; 18 | 19 | footnoteCall.className = 'footnote-ref'; // same class as Pandoc 20 | footnoteCall.setAttribute('id', 'fnref' + footnoteNumber); // same notation as Pandoc 21 | footnoteCall.setAttribute('href', '#' + footnote.id); 22 | footnoteCall.innerHTML = '' + footnoteNumber +''; 23 | parentElement.insertBefore(footnoteCall, footnote); 24 | 25 | // Here comes a hack. Fortunately, it works with Chrome and FF. 26 | var handler = document.createElement('p'); 27 | handler.className = 'footnoteHandler'; 28 | parentElement.insertBefore(handler, footnote); 29 | handler.appendChild(footnote); 30 | handler.style.display = 'inline-block'; 31 | handler.style.width = '100%'; 32 | handler.style.float = 'right'; 33 | handler.style.pageBreakInside = 'avoid'; 34 | } 35 | } 36 | 37 | afterPageLayout(pageFragment, page, breakToken) { 38 | function hasItemParent(node) { 39 | if (node.parentElement === null) { 40 | return false; 41 | } else { 42 | if (node.parentElement.tagName === 'LI') { 43 | return true; 44 | } else { 45 | return hasItemParent(node.parentElement); 46 | } 47 | } 48 | } 49 | // If a li item is broken, we store the reference of the p child element 50 | // see https://github.com/rstudio/pagedown/issues/23#issue-376548000 51 | if (breakToken !== undefined) { 52 | if (breakToken.node.nodeName === "#text" && hasItemParent(breakToken.node)) { 53 | this.splittedParagraphRefs.push(breakToken.node.parentElement.dataset.ref); 54 | } 55 | } 56 | } 57 | 58 | afterRendered(pages) { 59 | for (var page of pages) { 60 | var footnotes = page.element.querySelectorAll('.footnote'); 61 | if (footnotes.length === 0) { 62 | continue; 63 | } 64 | 65 | var pageContent = page.element.querySelector('.pagedjs_page_content'); 66 | var hr = document.createElement('hr'); 67 | var footnoteArea = document.createElement('div'); 68 | 69 | pageContent.style.display = 'flex'; 70 | pageContent.style.flexDirection = 'column'; 71 | 72 | hr.className = 'footnote-break'; 73 | hr.style.marginTop = 'auto'; 74 | hr.style.marginBottom = 0; 75 | hr.style.marginLeft = 0; 76 | hr.style.marginRight = 'auto'; 77 | pageContent.appendChild(hr); 78 | 79 | footnoteArea.className = 'footnote-area'; 80 | pageContent.appendChild(footnoteArea); 81 | 82 | for (var footnote of footnotes) { 83 | var handler = footnote.parentElement; 84 | 85 | footnoteArea.appendChild(footnote); 86 | handler.parentNode.removeChild(handler); 87 | 88 | footnote.innerHTML = '' + footnote.dataset.pagedownFootnoteNumber + '' + footnote.innerHTML; 89 | footnote.style.fontSize = 'x-small'; 90 | footnote.style.marginTop = 0; 91 | footnote.style.marginBottom = 0; 92 | footnote.style.paddingTop = 0; 93 | footnote.style.paddingBottom = 0; 94 | footnote.style.display = 'block'; 95 | } 96 | } 97 | 98 | for (var ref of this.splittedParagraphRefs) { 99 | var paragraphFirstPage = document.querySelector('[data-split-to="' + ref + '"]'); 100 | // We test whether the paragraph is empty 101 | // see https://github.com/rstudio/pagedown/issues/23#issue-376548000 102 | if (paragraphFirstPage.innerText === "") { 103 | paragraphFirstPage.parentElement.style.display = "none"; 104 | var paragraphSecondPage = document.querySelector('[data-split-from="' + ref + '"]'); 105 | paragraphSecondPage.parentElement.style.setProperty('list-style', 'inherit', 'important'); 106 | } 107 | } 108 | } 109 | }); 110 | -------------------------------------------------------------------------------- /11_poster_professional.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "When is the State of the Union Delivered?" 3 | author: "Dr. Evangeline (Gina) Reynolds^1^, James Smith^1,2^, and Jane Smith^3^" 4 | institute: "1. Korbel School of International Studies at University of Denver; 2. Department and University Two; 3. Department and University Three" 5 | date: "2018-11-30" 6 | references: 7 | - id: R-base 8 | author: 9 | - family: "R Core Team" 10 | given: "" 11 | title: 'R: A Language and Environment for Statistical Computing' 12 | issued: 13 | year: 2018 14 | URL: https://www.r-project.org 15 | - id: R-pagedown 16 | author: 17 | - family: Xie 18 | given: Yihui 19 | - family: Lesur 20 | given: Romain 21 | title: 'Paginate the HTML Output of R Markdown with CSS for Print' 22 | issued: 23 | year: 2018 24 | URL: https://github.com/rstudio/pagedown 25 | output: 26 | pagedown::poster_jacobs: 27 | self_contained: false 28 | pandoc_args: --mathjax 29 | --- 30 | 31 | 32 | 33 | 34 | ```{r setup, echo=FALSE, message=F, warning=F} 35 | knitr::opts_chunk$set(echo = F, warning = F, message = F) 36 | library(tidyverse) 37 | ``` 38 | 39 | Motivation {.block} 40 | ================================================================================ 41 | 42 | 43 | The State of the Union is an important summary of ... 44 | 45 | It's delivery is most often in January, but with the 2019 government shutdown ... 46 | 47 | Kenneth Bennoit raised the question about timing: 48 | 49 | > Far from unprecedented for a #stateoftheunion #SOTU address to be held in Feb or to be delivered written. 50 | 51 | 52 | 53 | 54 | Related Literature 55 | ================================================================================ 56 | 57 | Lorem ipsum dolor **sit amet**, consectetur adipiscing elit. Donec ut volutpat elit. Sed laoreet accumsan mattis. Integer sapien tellus, auctor ac blandit eget, sollicitudin vitae lorem. Praesent dictum tempor pulvinar. Suspendisse potenti. Sed tincidunt varius ipsum, et porta nulla suscipit et. Etiam congue bibendum felis, ac dictum augue cursus a. **Donec** magna eros, iaculis sit amet placerat quis, laoreet id est. 58 | 59 | 60 | 61 | 62 | 63 | Category | Description 64 | -----|------ 65 | Bad | Misrepresents data or confuse 66 | Ugly | Not pleasing 67 | Good | Not bad and not ugly 68 | 69 | Table: This is the caption for the table about data visualization categories from *"The Fundamentals of Data Visualization."* 70 | 71 | 72 | ```{r, gm-plot, fig.width=6, fig.height=3, dev='svg', out.width='100%', fig.cap='Figure Caption.', echo=FALSE} 73 | gapminder::gapminder %>% filter(year == 2007) %>% 74 | ggplot() + 75 | aes(gdpPercap, lifeExp) + 76 | geom_point() + 77 | theme_minimal() 78 | 79 | ``` 80 | 81 | Test citations @R-base @R-pagedown. See Figure \@ref(fig:gm-plot). 82 | 83 | 84 | 85 | 86 | Theory 87 | ================================================================================ 88 | 89 | The following materials were required to complete the research: 90 | 91 | 92 | - Curabitur pellentesque dignissim 93 | - Eu facilisis est tempus quis 94 | - Duis porta consequat lorem 95 | - Eu facilisis est tempus quis 96 | 97 | 98 | The materials were prepared according to the steps outlined below: 99 | 100 | 1. Curabitur pellentesque dignissim 101 | 1. Eu facilisis est tempus quis 102 | 1. Duis porta consequat lorem 103 | 1. Curabitur pellentesque dignissim 104 | 105 | 106 | 107 | 108 | Hypotheses 109 | ================================================================================ 110 | 111 | Lorem ipsum dolor **sit amet**, consectetur adipiscing elit. Sed laoreet accumsan mattis. Integer sapien tellus, auctor ac blandit eget, sollicitudin vitae lorem. Praesent dictum tempor pulvinar. Suspendisse potenti. Sed tincidunt varius ipsum, et porta nulla suscipit et. Etiam congue bibendum felis, ac dictum augue cursus a. **Donec** magna eros, iaculis sit amet placerat quis, laoreet id est. In ut orci purus, interdum ornare nibh. Pellentesque pulvinar, nibh ac malesuada accumsan, urna nunc convallis tortor, ac vehicula nulla tellus eget nulla. Nullam lectus tortor, _consequat tempor hendrerit_ quis, vestibulum in diam. Maecenas sed diam augue. 112 | 113 | 114 | 115 | 116 | Important Result {.block} 117 | ================================================================================ 118 | 119 | It is rare for the State of the Union, when it does not fall in an election year, to be delivered as late as February. However the addresses overall are getting later and later, and the 2019 address timing does not represent an outlying case. 120 | 121 | 122 | 123 | 124 | Data 125 | ================================================================================ 126 | 127 | ::: {.figure-example} 128 | ```{r year, fig.cap = "Timing of state of the union by year. SOTUs that follow election years are colored with blue.", fig.align='center'} 129 | # Include the figure that you have saved out in working files 130 | knitr::include_graphics("figures/sotu_timing_delivery.png") 131 | ``` 132 | 133 | Figure 2: Figure caption. 134 | ::: 135 | 136 | Nunc tempus venenatis facilisis. Curabitur suscipit consequat eros non porttitor. Sed a massa dolor, id ornare enim: 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | Model 145 | ================================================================================ 146 | 147 | ```{r regtable, results = "asis"} 148 | # load models that have been saved in .Rdata file previously 149 | load("data_products/models.Rdata") 150 | stargazer::stargazer(lateness_by_year, 151 | lateness_following_election, lateness_full, lateness_full_interaction, 152 | dep.var.labels = "Days elapsed since January 1st", 153 | covariate.labels = c("year", "post election", "year*post election"), 154 | title = "Predicting State of the Union Timing", 155 | style = "qje", 156 | omit.stat = "all", 157 | type = "html") 158 | ``` 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | Conclusions 185 | ================================================================================ 186 | 187 | 188 | 189 | ::: {.figure-example} 190 | ```{r model, fig.cap = "Timing of state of the union by year", fig.align='center'} 191 | # Include the figure that you have saved out in working files 192 | knitr::include_graphics("figures/sotu_timing_model.png", dpi = 250) 193 | ``` 194 | 195 | ::: 196 | 197 | 198 | 199 | Key References 200 | ================================================================================ 201 | 202 |
203 | 204 | 205 | ```{r} 206 | download.file("https://onedrive.live.com/view.aspx?resid=43EBDBC5D5265516!12284&ithint=file%2cxlsx&app=Excel&authkey=!AHoBkJE4yhL8sOI", "temp.xlsx") 207 | ``` 208 | 209 | 210 | Data sources {data-color=red} 211 | ================================================================================ 212 | 213 | Nam mollis tristique neque eu luctus. Suspendisse rutrum congue nisi sed convallis. Aenean id neque dolor. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. 214 | 215 | 216 | Nam mollis tristique neque eu luctus. Suspendisse rutrum congue nisi sed convallis. Aenean id neque dolor. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. 217 | 218 | 219 | 220 | 221 | 222 | -------------------------------------------------------------------------------- /11_poster_professional.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | When is the State of the Union Delivered? 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 |

When is the State of the Union Delivered?

25 |

Dr. Evangeline (Gina) Reynolds1, James Smith1,2, and Jane Smith3

26 |

1. Korbel School of International Studies at University of Denver; 2. Department and University Two; 3. Department and University Three

27 |
28 | 29 | 30 |
31 |

Motivation

32 |

The State of the Union is an important summary of …

33 |

It’s delivery is most often in January, but with the 2019 government shutdown …

34 |

Kenneth Bennoit raised the question about timing:

35 |
36 |

Far from unprecedented for a #stateoftheunion #SOTU address to be held in Feb or to be delivered written.

37 |
38 |
39 | 73 |
74 |

Theory

75 |

The following materials were required to complete the research:

76 | 82 |

The materials were prepared according to the steps outlined below:

83 |
    84 |
  1. Curabitur pellentesque dignissim
  2. 85 |
  3. Eu facilisis est tempus quis
  4. 86 |
  5. Duis porta consequat lorem
  6. 87 |
  7. Curabitur pellentesque dignissim
  8. 88 |
89 |
90 |
91 |

Hypotheses

92 |

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed laoreet accumsan mattis. Integer sapien tellus, auctor ac blandit eget, sollicitudin vitae lorem. Praesent dictum tempor pulvinar. Suspendisse potenti. Sed tincidunt varius ipsum, et porta nulla suscipit et. Etiam congue bibendum felis, ac dictum augue cursus a. Donec magna eros, iaculis sit amet placerat quis, laoreet id est. In ut orci purus, interdum ornare nibh. Pellentesque pulvinar, nibh ac malesuada accumsan, urna nunc convallis tortor, ac vehicula nulla tellus eget nulla. Nullam lectus tortor, consequat tempor hendrerit quis, vestibulum in diam. Maecenas sed diam augue.

93 |
94 |
95 |

Important Result

96 |

It is rare for the State of the Union, when it does not fall in an election year, to be delivered as late as February. However the addresses overall are getting later and later, and the 2019 address timing does not represent an outlying case.

97 |
98 |
99 |

Data

100 |
101 |
102 | Timing of state of the union by year.  SOTUs that follow election years are colored with blue. 103 |

104 | Figure 2: Timing of state of the union by year. SOTUs that follow election years are colored with blue. 105 |

106 |
107 |

Figure 2: Figure caption.

108 |
109 |

Nunc tempus venenatis facilisis. Curabitur suscipit consequat eros non porttitor. Sed a massa dolor, id ornare enim:

110 |
111 |
112 |

Model

113 | 114 | 117 | 118 | 120 | 121 | 122 | 124 | 127 | 128 | 129 | 131 | 134 | 137 | 140 | 143 | 144 | 145 | 147 | 148 | 149 | 152 | 155 | 157 | 160 | 163 | 164 | 165 | 167 | 170 | 172 | 175 | 178 | 179 | 180 | 182 | 184 | 186 | 188 | 190 | 191 | 192 | 195 | 197 | 200 | 203 | 206 | 207 | 208 | 210 | 212 | 215 | 218 | 221 | 222 | 223 | 225 | 227 | 229 | 231 | 233 | 234 | 235 | 238 | 240 | 242 | 244 | 247 | 248 | 249 | 251 | 253 | 255 | 257 | 260 | 261 | 262 | 264 | 266 | 268 | 270 | 272 | 273 | 274 | 277 | 280 | 283 | 286 | 289 | 290 | 291 | 293 | 296 | 299 | 302 | 305 | 306 | 307 | 309 | 311 | 313 | 315 | 317 | 318 | 319 | 321 | 322 | 323 | 326 | 329 | 330 | 331 | 333 | 336 | 337 | 338 | 340 | 343 | 344 |
115 | Predicting State of the Union Timing 116 |
119 |
123 | 125 | Days elapsed since January 1st 126 |
130 | 132 | (1) 133 | 135 | (2) 136 | 138 | (3) 139 | 141 | (4) 142 |
146 |
150 | year 151 | 153 | 0.401*** 154 | 156 | 158 | 0.408*** 159 | 161 | 0.320*** 162 |
166 | 168 | (0.038) 169 | 171 | 173 | (0.035) 174 | 176 | (0.036) 177 |
181 | 183 | 185 | 187 | 189 |
193 | post election 194 | 196 | 198 | 7.700** 199 | 201 | 8.654*** 202 | 204 | -653.628*** 205 |
209 | 211 | 213 | (2.991) 214 | 216 | (1.894) 217 | 219 | (139.861) 220 |
224 | 226 | 228 | 230 | 232 |
236 | year*post election 237 | 239 | 241 | 243 | 245 | 0.335*** 246 |
250 | 252 | 254 | 256 | 258 | (0.071) 259 |
263 | 265 | 267 | 269 | 271 |
275 | Constant 276 | 278 | -773.950*** 279 | 281 | 17.300*** 282 | 284 | -789.534*** 285 | 287 | -615.478*** 288 |
292 | 294 | (75.412) 295 | 297 | (1.511) 298 | 300 | (68.468) 301 | 303 | (71.731) 304 |
308 | 310 | 312 | 314 | 316 |
320 |
324 | Notes: 325 | 327 | ***Significant at the 1 percent level. 328 |
332 | 334 | **Significant at the 5 percent level. 335 |
339 | 341 | *Significant at the 10 percent level. 342 |
345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 |
361 |
362 |

Conclusions

363 |
364 |
365 | Timing of state of the union by year 366 |

367 | Figure 3: Timing of state of the union by year 368 |

369 |
370 |
371 |
372 |
373 |

Key References

374 |
375 |
376 |

R Core Team. 2018. “R: A Language and Environment for Statistical Computing.” https://www.r-project.org.

377 |
378 |
379 |

Xie, Yihui, and Romain Lesur. 2018. “Paginate the HTML Output of R Markdown with CSS for Print.” https://github.com/rstudio/pagedown.

380 |
381 |
382 |
383 |
384 |

Data sources

385 |

Nam mollis tristique neque eu luctus. Suspendisse rutrum congue nisi sed convallis. Aenean id neque dolor. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.

386 |

Nam mollis tristique neque eu luctus. Suspendisse rutrum congue nisi sed convallis. Aenean id neque dolor. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.

387 |
388 | 389 | 417 | 418 | 419 | 420 | 421 | 422 | -------------------------------------------------------------------------------- /11_poster_professional_empty.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "When is the State of the Union Delivered?" 3 | author: "Dr. Evangeline (Gina) Reynolds^1^, James Smith^1,2^, and Jane Smith^3^" 4 | institute: "1. Korbel School of International Studies at University of Denver; 2. Department and University Two; 3. Department and University Three" 5 | date: "2018-11-30" 6 | references: 7 | - id: R-base 8 | author: 9 | - family: "R Core Team" 10 | given: "" 11 | title: 'R: A Language and Environment for Statistical Computing' 12 | issued: 13 | year: 2018 14 | URL: https://www.r-project.org 15 | - id: R-pagedown 16 | author: 17 | - family: Xie 18 | given: Yihui 19 | - family: Lesur 20 | given: Romain 21 | title: 'Paginate the HTML Output of R Markdown with CSS for Print' 22 | issued: 23 | year: 2018 24 | URL: https://github.com/rstudio/pagedown 25 | output: 26 | pagedown::poster_jacobs: 27 | self_contained: false 28 | pandoc_args: --mathjax 29 | --- 30 | 31 | 32 | 33 | 34 | ```{r setup, echo=FALSE, message=F, warning=F} 35 | knitr::opts_chunk$set(echo = F, warning = F, message = F) 36 | library(tidyverse) 37 | ``` 38 | 39 | Motivation {.block} 40 | ================================================================================ 41 | 42 | 43 | 44 | Related Literature 45 | ================================================================================ 46 | 47 | 48 | 49 | 50 | 51 | 52 | Theory 53 | ================================================================================ 54 | 55 | 56 | 57 | 58 | Hypotheses 59 | ================================================================================ 60 | 61 | 62 | 63 | 64 | Important Result {.block} 65 | ================================================================================ 66 | 67 | 68 | Data 69 | ================================================================================ 70 | 71 | 72 | 73 | 74 | 75 | 76 | Model 77 | ================================================================================ 78 | 79 | 80 | 81 | Conclusions 82 | ================================================================================ 83 | 84 | 85 | Key References 86 | ================================================================================ 87 | 88 | 89 | 90 | Data sources {data-color=red} 91 | ================================================================================ 92 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /11_poster_professional_empty.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | When is the State of the Union Delivered? 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 |

When is the State of the Union Delivered?

25 |

Dr. Evangeline (Gina) Reynolds1, James Smith1,2, and Jane Smith3

26 |

1. Korbel School of International Studies at University of Denver; 2. Department and University Two; 3. Department and University Three

27 |
28 | 29 | 30 |
31 |

Motivation

32 |
33 | 36 |
37 |

Theory

38 |
39 |
40 |

Hypotheses

41 |
42 |
43 |

Important Result

44 |
45 |
46 |

Data

47 |
48 |
49 |

Model

50 |
51 |
52 |

Conclusions

53 |
54 |
55 |

Key References

56 |
57 |
58 |

Data sources

59 |
60 | 61 | 89 | 90 | 91 | 92 | 93 | 94 | -------------------------------------------------------------------------------- /11_poster_professional_empty_files/paged-0.1.4/css/poster-jacobs.css: -------------------------------------------------------------------------------- 1 | @page { 2 | size: 46.8in 33.1in; 3 | margin: 0; 4 | } 5 | * { 6 | box-sizing: border-box; 7 | } 8 | html { 9 | width: 46.8in; 10 | height: 33.09in; 11 | } 12 | body { 13 | margin: 0; 14 | font-size: 32px; 15 | width: 100%; 16 | height: 99.9%; 17 | grid-gap: 1.2in; 18 | padding: 1.2in; 19 | font-family: Optima, Calibri, sans-serif; 20 | } 21 | 22 | body { 23 | display: grid; 24 | grid-template-areas: 25 | 'S1 S1 S1 S1' 26 | 'S2 S4 S5 S9' 27 | 'S2 S4 S5 S9' 28 | 'S2 S4 S5 S9' 29 | 'S2 S6 S6 S10' 30 | 'S3 S7 S8 S11' 31 | 'S3 S7 S8 S11' 32 | 'S3 S7 S8 S11' 33 | 'S3 S7 S8 S12' 34 | 'S3 S7 S8 S12'; 35 | grid-template-columns: repeat(4, 1fr); 36 | grid-template-rows: repeat(10, 1fr); 37 | } 38 | 39 | .section-1 { grid-area: S1; } 40 | .section-2 { grid-area: S2; } 41 | .section-3 { grid-area: S3; } 42 | .section-4 { grid-area: S4; } 43 | .section-5 { grid-area: S5; } 44 | .section-6 { grid-area: S6; } 45 | .section-7 { grid-area: S7; } 46 | .section-8 { grid-area: S8; } 47 | .section-9 { grid-area: S9; } 48 | .section-10 { grid-area: S10; } 49 | .section-11 { grid-area: S11; } 50 | .section-12 { grid-area: S12; } 51 | 52 | h1, .poster-title, .figure { 53 | text-align: center; 54 | } 55 | 56 | .poster-title h1 { 57 | font-family: "Gill Sans", Verdana, sans-serif; 58 | font-size: 3em; 59 | color: darkblue; 60 | } 61 | 62 | .poster-title { 63 | border-bottom: .08in solid darkblue; 64 | } 65 | 66 | h1 { 67 | color: limegreen; 68 | margin: 0; 69 | padding: .5em; 70 | font-size: 1.5em; 71 | } 72 | 73 | .block { 74 | border: .1in solid steelblue; 75 | background-color: aliceblue; 76 | } 77 | 78 | .block h1 { 79 | background-color: steelblue; 80 | color: white; 81 | } 82 | 83 | .block > .content { 84 | padding: 1em; 85 | line-height: 1.5em; 86 | } 87 | 88 | table { 89 | margin: auto; 90 | border-top: 3px solid #666; 91 | border-bottom: 3px solid #666; 92 | } 93 | table thead th { border-bottom: 3px solid #ddd; } 94 | td { padding: 8px; } 95 | th { padding: 15px; } 96 | caption { margin-bottom: 10px; } 97 | 98 | a { text-decoration: none; } 99 | 100 | h1 hr { 101 | border: 6px solid gray; 102 | clip-path: ellipse(50% 3px at center); 103 | margin: 0; 104 | } 105 | 106 | .figure-example { 107 | text-align: center; 108 | } 109 | 110 | .figure-example p:first-child { 111 | background-color: floralwhite; 112 | border: 5px dotted gray; 113 | width: 90%; 114 | height: 12em; 115 | padding: 1em 0; 116 | margin: 0 auto; 117 | } 118 | 119 | .logo-example { 120 | display: flex; 121 | flex-wrap: wrap; 122 | justify-content: space-between; 123 | } 124 | .logo-example > p { 125 | width: 30%; 126 | border: 5px dotted sandybrown; 127 | background-color: whitesmoke; 128 | height: 5em; 129 | text-align: center; 130 | } 131 | -------------------------------------------------------------------------------- /11_poster_professional_files/paged-0.1.4/css/poster-jacobs.css: -------------------------------------------------------------------------------- 1 | @page { 2 | size: 46.8in 33.1in; 3 | margin: 0; 4 | } 5 | * { 6 | box-sizing: border-box; 7 | } 8 | html { 9 | width: 46.8in; 10 | height: 33.09in; 11 | } 12 | body { 13 | margin: 0; 14 | font-size: 32px; 15 | width: 100%; 16 | height: 99.9%; 17 | grid-gap: 1.2in; 18 | padding: 1.2in; 19 | font-family: Optima, Calibri, sans-serif; 20 | } 21 | 22 | body { 23 | display: grid; 24 | grid-template-areas: 25 | 'S1 S1 S1 S1' 26 | 'S2 S4 S5 S9' 27 | 'S2 S4 S5 S9' 28 | 'S2 S4 S5 S9' 29 | 'S2 S6 S6 S10' 30 | 'S3 S7 S8 S11' 31 | 'S3 S7 S8 S11' 32 | 'S3 S7 S8 S11' 33 | 'S3 S7 S8 S12' 34 | 'S3 S7 S8 S12'; 35 | grid-template-columns: repeat(4, 1fr); 36 | grid-template-rows: repeat(10, 1fr); 37 | } 38 | 39 | .section-1 { grid-area: S1; } 40 | .section-2 { grid-area: S2; } 41 | .section-3 { grid-area: S3; } 42 | .section-4 { grid-area: S4; } 43 | .section-5 { grid-area: S5; } 44 | .section-6 { grid-area: S6; } 45 | .section-7 { grid-area: S7; } 46 | .section-8 { grid-area: S8; } 47 | .section-9 { grid-area: S9; } 48 | .section-10 { grid-area: S10; } 49 | .section-11 { grid-area: S11; } 50 | .section-12 { grid-area: S12; } 51 | 52 | h1, .poster-title, .figure { 53 | text-align: center; 54 | } 55 | 56 | .poster-title h1 { 57 | font-family: "Gill Sans", Verdana, sans-serif; 58 | font-size: 3em; 59 | color: darkblue; 60 | } 61 | 62 | .poster-title { 63 | border-bottom: .08in solid darkblue; 64 | } 65 | 66 | h1 { 67 | color: limegreen; 68 | margin: 0; 69 | padding: .5em; 70 | font-size: 1.5em; 71 | } 72 | 73 | .block { 74 | border: .1in solid steelblue; 75 | background-color: aliceblue; 76 | } 77 | 78 | .block h1 { 79 | background-color: steelblue; 80 | color: white; 81 | } 82 | 83 | .block > .content { 84 | padding: 1em; 85 | line-height: 1.5em; 86 | } 87 | 88 | table { 89 | margin: auto; 90 | border-top: 3px solid #666; 91 | border-bottom: 3px solid #666; 92 | } 93 | table thead th { border-bottom: 3px solid #ddd; } 94 | td { padding: 8px; } 95 | th { padding: 15px; } 96 | caption { margin-bottom: 10px; } 97 | 98 | a { text-decoration: none; } 99 | 100 | h1 hr { 101 | border: 6px solid gray; 102 | clip-path: ellipse(50% 3px at center); 103 | margin: 0; 104 | } 105 | 106 | .figure-example { 107 | text-align: center; 108 | } 109 | 110 | .figure-example p:first-child { 111 | background-color: floralwhite; 112 | border: 5px dotted gray; 113 | width: 90%; 114 | height: 12em; 115 | padding: 1em 0; 116 | margin: 0 auto; 117 | } 118 | 119 | .logo-example { 120 | display: flex; 121 | flex-wrap: wrap; 122 | justify-content: space-between; 123 | } 124 | .logo-example > p { 125 | width: 30%; 126 | border: 5px dotted sandybrown; 127 | background-color: whitesmoke; 128 | height: 5em; 129 | text-align: center; 130 | } 131 | -------------------------------------------------------------------------------- /11_poster_relaxed.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "An HTML poster example" 3 | author: "Yihui Xie" 4 | date: "`r Sys.Date()`" 5 | output: 6 | pagedown::poster_relaxed: 7 | self_contained: false 8 | bibliography: packages.bib 9 | references: 10 | - id: remarkjs 11 | author: 12 | - family: Bang 13 | given: Ole Petter 14 | title: 'A simple, in-browser, markdown-driven slideshow tool' 15 | issued: 16 | year: 2018 17 | URL: https://remarkjs.com 18 | - id: naruto 19 | author: 20 | - family: Kishimoto 21 | given: Masashi 22 | title: 'Naruto Shippūden' 23 | issued: 24 | year: 2007 25 | URL: https://en.wikipedia.org/wiki/Naruto 26 | --- 27 | 28 | 29 | 30 | 31 | 32 | ```{r, echo=FALSE} 33 | knitr::opts_chunk$set(echo = F, warning = F, message = F) 34 | ``` 35 | 36 | 37 | 38 | Presentation Ninja [with]{.tiny} R and xaringan 39 | ================================================================================ 40 | 41 | In late 2016, Yihui discovered remark.js [@remarkjs] and loved it at the first sight. A few weeks later in the R Markdown ecosystem [@R-rmarkdown], an R package was born and named **xaringan** [@R-xaringan], which nobody knows how to pronounce (including Yihui himself, because it was adapted from the Japanese manga series Naruto by @naruto). Anyway, this package has gained some popularity, and some CSS ninja have started contributing themes to it. One day, Yihui was thinking about creating a gallery for existing themes in **xaringan**. After a few replies in the [Github issue](https://github.com/yihui/xaringan/issues/172), he realized there might be enough topics on **xaringan** for a short book. Accidentally, he invented a new development model for writing books: the Github-issue-driven book development. 42 | 43 | 44 | 45 | 46 | [Authors]{.red} 47 | ================================================================================ 48 | 49 | We are a team of shinobi and kunoichi who wish to share the fun and secrets of the **xaringan** package with you. 50 | 51 | ::: member-cards 52 | ## Emi Tanaka 53 | 54 | ![Emi](https://avatars3.githubusercontent.com/u/7620319?s=400&v=4) 55 | 56 | Lead author, and the ninja theme author 57 | 58 | Emi laid out the first sketch of the book, which made Yihui believe that the book had been half-done. 59 | 60 | ## Joseph Casillas 61 | 62 | ![](https://avatars1.githubusercontent.com/u/1747068?s=400&v=4) 63 | 64 | Contributor of **xaringan** 65 | 66 | "Count me in," replied Joseph when Yihui asked who wanted to co-author the book. 67 | 68 | ## Eric Nantz 69 | 70 | ![](https://avatars0.githubusercontent.com/u/1043111?s=400&v=4) 71 | 72 | Host of the R Podcast 73 | 74 | Yihui is eager to know how much Eric's writing is better than his magnetic voice. 75 | 76 | ## Yihui Xie 77 | 78 | ![](https://avatars0.githubusercontent.com/u/163582?s=400&v=4) 79 | 80 | Main author of **xaringan** 81 | 82 | Yihui knows a bit about R/HTML/CSS/JS and wrote **knitr** [@R-knitr], which became a cornerstone of R Markdown. 83 | ::: 84 | 85 | [All pictures above are from the authors' Github profiles. This poster was created via the R package [**pagedown**](https://github.com/rstudio/pagedown).]{.disclaimer} 86 | 87 | 88 | 89 | 90 | [Motivation]{.blue} 91 | ================================================================================ 92 | 93 | ```{r, include=FALSE} 94 | lorem = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, qui officia deserunt mollit anim id est laborum.' 95 | ``` 96 | 97 | ## There are many secrets about **xaringan**, **knitr**, and R Markdown to be revealed 98 | 99 | `r lorem` 100 | 101 | ![The **xaringan** logo, adapted from Sharingan of the Uchiha clan.](https://user-images.githubusercontent.com/163582/45438104-ea200600-b67b-11e8-80fa-d9f2a99a03b0.png) 102 | 103 | ## HTML/CSS/JS are fun to play with 104 | 105 | `r paste('-', strwrap(lorem, 230), collapse = '\n')` 106 | 107 | 108 | 109 | 110 | [Schedule]{.pink} 111 | ================================================================================ 112 | 113 | ```{css, echo=FALSE} 114 | .section-4 { 115 | background-image: url(https://upload.wikimedia.org/wikipedia/commons/7/7e/Mudra-Naruto-KageBunshin.svg) !important; 116 | background-size: 40% !important; 117 | background-position: right top !important; 118 | background-repeat: no-repeat !important; 119 | } 120 | ``` 121 | 122 | 123 | ## Outline (2018-12-15) 124 | 125 | `r lorem` 126 | 127 | ## Content (2019-03-01) 128 | 129 | `r lorem` 130 | 131 | ## Review and revision (2019-03-31) 132 | 133 | `r lorem` 134 | 135 | ## Copyediting (2019-04-20) 136 | 137 | `r lorem` 138 | 139 | ## Publishing (2019-05-30) 140 | 141 | `r lorem` 142 | 143 | 144 | 145 | 146 | [Contents]{.green} 147 | ================================================================================ 148 | 149 | `r lorem` 150 | 151 | ```{r regtable, results = "asis"} 152 | # load models that have been saved in .Rdata file previously 153 | load("data_products/models.Rdata") 154 | stargazer::stargazer(lateness_by_year, 155 | lateness_following_election, lateness_full, lateness_full_interaction, 156 | dep.var.labels = "Days elapsed since January 1st", 157 | covariate.labels = c("year", "post election", "year*post election"), 158 | title = "The table title", 159 | style = "qje", 160 | type = "html") 161 | ``` 162 | 163 | `r lorem` 164 | 165 | ```r 166 | # some nice R code here 167 | 1 + 1 168 | fit = lm(dist ~ speed, cars) 169 | ``` 170 | `r lorem` 171 | 172 | ![The most well-known feature of **xaringan**: the random Moustache Karl (aka `yolo = TRUE`).](https://github.com/yihui/xaringan/releases/download/v0.0.2/karl-moustache.jpg) 173 | 174 | `r lorem` 175 | 176 | $$\bar{X}=\frac{1}{n}\sum_{i=1}^nX_i$$ 177 | 178 | `r lorem` 179 | 180 | ```{r, fig.cap = "Timing of state of the union by year. SOTUs that follow election years are colored with blue.", fig.align='center'} 181 | # Include the figure that you have saved out in working files 182 | knitr::include_graphics("figures/num_speeches_per_pres.png") 183 | ``` 184 | 185 | 186 | [Bibliography]{.yellow} 187 | ================================================================================ 188 | 189 | ```{r, include=FALSE} 190 | knitr::write_bib(c('knitr', 'rmarkdown', 'xaringan'), 'packages.bib') 191 | ``` 192 | -------------------------------------------------------------------------------- /11_poster_relaxed.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | An HTML poster example 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 |

Policy insights for Venezuela’s Future

26 |
27 |
28 |

Authors

29 |
30 |
31 |

Motivation

32 |
33 |
34 |

Schedule

35 |
36 |
37 |

Contents

38 |
39 |
40 |

Bibliography

41 |
42 | 43 | 120 | 121 | 122 | 123 | 124 | 125 | -------------------------------------------------------------------------------- /11_poster_relaxed_empty.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "An HTML poster example" 3 | author: "Yihui Xie" 4 | date: "`r Sys.Date()`" 5 | output: 6 | pagedown::poster_relaxed: 7 | self_contained: false 8 | bibliography: packages.bib 9 | references: 10 | - id: remarkjs 11 | author: 12 | - family: Bang 13 | given: Ole Petter 14 | title: 'A simple, in-browser, markdown-driven slideshow tool' 15 | issued: 16 | year: 2018 17 | URL: https://remarkjs.com 18 | - id: naruto 19 | author: 20 | - family: Kishimoto 21 | given: Masashi 22 | title: 'Naruto Shippūden' 23 | issued: 24 | year: 2007 25 | URL: https://en.wikipedia.org/wiki/Naruto 26 | --- 27 | 28 | 29 | 30 | 31 | 32 | Presentation Ninja [with]{.tiny} R and xaringan 33 | ================================================================================ 34 | 35 | 36 | 37 | 38 | 39 | [Authors]{.red} 40 | ================================================================================ 41 | 42 | 43 | 44 | 45 | 46 | [Motivation]{.blue} 47 | ================================================================================ 48 | 49 | 50 | 51 | 52 | 53 | [Schedule]{.pink} 54 | ================================================================================ 55 | 56 | 57 | 58 | 59 | 60 | [Contents]{.green} 61 | ================================================================================ 62 | 63 | 64 | 65 | [Bibliography]{.yellow} 66 | ================================================================================ 67 | 68 | ```{r, include=FALSE} 69 | knitr::write_bib(c('knitr', 'rmarkdown', 'xaringan'), 'packages.bib') 70 | ``` 71 | -------------------------------------------------------------------------------- /11_poster_relaxed_empty.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | An HTML poster example 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 |

Presentation Ninja with R and xaringan

25 |
26 |
27 |

Authors

28 |
29 |
30 |

Motivation

31 |
32 |
33 |

Schedule

34 |
35 |
36 |

Contents

37 |
38 |
39 |

Bibliography

40 |
41 | 42 | 119 | 120 | 121 | 122 | 123 | 124 | -------------------------------------------------------------------------------- /11_poster_relaxed_empty_files/paged-0.1.4/css/poster-relaxed.css: -------------------------------------------------------------------------------- 1 | @import 'https://fonts.googleapis.com/css?family=Paytone+One|PT+Sans'; 2 | @import 'https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.3.1/semantic.min.css'; 3 | 4 | @page { 5 | size: 46.8in 33.1in; 6 | margin: 0; 7 | } 8 | html, body { 9 | background: #cce7f1; 10 | } 11 | html { 12 | font-family: "PT Sans"; 13 | width: 46.8in; 14 | height: 33.09669in; 15 | } 16 | body { 17 | margin: 0; 18 | width: 100% !important; 19 | height: 100% !important; 20 | display: grid; 21 | grid-gap: 1.2in; 22 | grid-template-columns: 60px 60px; 23 | padding: 1.2in !important; 24 | } 25 | div .title.ribbon { 26 | font-size: 0.6in; 27 | border-radius: 0 0.2in 0.2in 0 !important; 28 | } 29 | .content { 30 | max-width: 100%; 31 | } 32 | p { 33 | margin-top: 0.5em; 34 | } 35 | body, p, .math, li { 36 | font-size: 32px; 37 | } 38 | h2 { 39 | font-size: 48px; 40 | } 41 | .figure { 42 | break-inside: avoid; 43 | box-shadow: 0 1px 3px 0 #d4d4d5, 0 0 0 1px #d4d4d5; 44 | color: #666; 45 | padding: 1em; 46 | } 47 | img { 48 | max-width: 100%; 49 | } 50 | .figure img { 51 | display: block; 52 | margin: auto; 53 | } 54 | .figure .caption { 55 | font-size: 24px; 56 | } 57 | .card { 58 | line-height: 1.3em; 59 | } 60 | pre { 61 | box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); 62 | width: 100%; 63 | padding: 0.8em; 64 | font-size: 36px; 65 | } 66 | body { 67 | grid-template-areas: 68 | "P P H H H M M" 69 | "P P H H H M M" 70 | "P P U U U M M" 71 | "R R R R R M M" 72 | "R R R R R S S"; 73 | grid-template-columns: repeat(7, 1fr); 74 | grid-template-rows: repeat(5, 1fr); 75 | } 76 | .section-1 { 77 | grid-area: H; 78 | } 79 | .section-2 { 80 | grid-area: U; 81 | } 82 | .section-3 { 83 | grid-area: P; 84 | } 85 | .section-4 { 86 | grid-area: M; 87 | } 88 | .section-5 { 89 | grid-area: R; 90 | } 91 | .section-6 { 92 | grid-area: S; 93 | } 94 | 95 | .section-1 h1 { 96 | margin: 0; 97 | font-size: 1.5in; 98 | font-family: "Paytone One"; 99 | text-align: center; 100 | text-transform: uppercase; 101 | color: #2c2c2c; 102 | letter-spacing: .05em; 103 | text-shadow: 0.04em 0.04em 0px #cdeaf4, 0.07em 0.07em 0px rgba(0, 0, 0, 0.2); 104 | } 105 | .section-1 h1 .tiny { 106 | display: block; 107 | text-shadow: none; 108 | font-size: 0.5em; 109 | text-transform: none; 110 | margin-top: -0.7em; 111 | margin-bottom: -0.7em; 112 | } 113 | .section-1 p { 114 | font-family: "Paytone One"; 115 | width: 100%; 116 | height: auto; 117 | outline: 0.1in dashed #98abb9; 118 | outline-offset: -0.3in; 119 | background-color: #556068; 120 | margin-top: 1in; 121 | -webkit-box-shadow: 0.1in 0.1in 0.1in #000; 122 | color: #ffffffdd; 123 | text-align: justify; 124 | padding: 2.3em; 125 | } 126 | .section-1 a { 127 | color: #fbbd08; 128 | } 129 | 130 | .section-2 p { 131 | float: left; 132 | margin: 0.5in 0.5cm auto 1cm; 133 | width: 22%; 134 | } 135 | .section-2 .card { 136 | display: inline-block; 137 | height: 11cm; 138 | vertical-align: top; 139 | margin-right: 0.8cm; 140 | margin-top: -3cm !important; 141 | } 142 | .section-2 .disclaimer { 143 | position: absolute; 144 | bottom: -0.6em; 145 | right: 0.6em; 146 | color: #aaa; 147 | } 148 | .section-2 .member-cards { 149 | float: right; 150 | } 151 | 152 | .section-3 .content, .section-4 .content, .section-5 .content { 153 | padding: 1cm; 154 | text-align: justify; 155 | } 156 | 157 | .section-5 .content { 158 | margin-top: -2cm; 159 | column-count: 4; 160 | column-gap: 2cm; 161 | column-fill: auto; 162 | padding-bottom: 0.3cm; 163 | padding-top: 0.3cm; 164 | } 165 | .section-5 .content > p:first-of-type { 166 | margin-top: 3cm; 167 | } 168 | 169 | .section-6 .content { 170 | margin-top: -2cm; 171 | column-count: 2; 172 | column-gap: 2cm; 173 | column-fill: auto; 174 | padding: 1cm; 175 | padding-bottom: 0.3cm; 176 | padding-top: 0.3cm; 177 | } 178 | .section-6 .content p { 179 | font-size: 26px; 180 | margin-bottom: 0.2cm; 181 | } 182 | .section-6 .content .references div:first-child { 183 | margin-top: 3cm; 184 | } 185 | 186 | @media screen { 187 | body { 188 | overflow-x: auto; 189 | } 190 | } 191 | -------------------------------------------------------------------------------- /11_poster_relaxed_files/paged-0.1.4/css/poster-relaxed.css: -------------------------------------------------------------------------------- 1 | @import 'https://fonts.googleapis.com/css?family=Paytone+One|PT+Sans'; 2 | @import 'https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.3.1/semantic.min.css'; 3 | 4 | @page { 5 | size: 46.8in 33.1in; 6 | margin: 0; 7 | } 8 | html, body { 9 | background: #cce7f1; 10 | } 11 | html { 12 | font-family: "PT Sans"; 13 | width: 46.8in; 14 | height: 33.09669in; 15 | } 16 | body { 17 | margin: 0; 18 | width: 100% !important; 19 | height: 100% !important; 20 | display: grid; 21 | grid-gap: 1.2in; 22 | grid-template-columns: 60px 60px; 23 | padding: 1.2in !important; 24 | } 25 | div .title.ribbon { 26 | font-size: 0.6in; 27 | border-radius: 0 0.2in 0.2in 0 !important; 28 | } 29 | .content { 30 | max-width: 100%; 31 | } 32 | p { 33 | margin-top: 0.5em; 34 | } 35 | body, p, .math, li { 36 | font-size: 32px; 37 | } 38 | h2 { 39 | font-size: 48px; 40 | } 41 | .figure { 42 | break-inside: avoid; 43 | box-shadow: 0 1px 3px 0 #d4d4d5, 0 0 0 1px #d4d4d5; 44 | color: #666; 45 | padding: 1em; 46 | } 47 | img { 48 | max-width: 100%; 49 | } 50 | .figure img { 51 | display: block; 52 | margin: auto; 53 | } 54 | .figure .caption { 55 | font-size: 24px; 56 | } 57 | .card { 58 | line-height: 1.3em; 59 | } 60 | pre { 61 | box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); 62 | width: 100%; 63 | padding: 0.8em; 64 | font-size: 36px; 65 | } 66 | body { 67 | grid-template-areas: 68 | "P P H H H M M" 69 | "P P H H H M M" 70 | "P P U U U M M" 71 | "R R R R R M M" 72 | "R R R R R S S"; 73 | grid-template-columns: repeat(7, 1fr); 74 | grid-template-rows: repeat(5, 1fr); 75 | } 76 | .section-1 { 77 | grid-area: H; 78 | } 79 | .section-2 { 80 | grid-area: U; 81 | } 82 | .section-3 { 83 | grid-area: P; 84 | } 85 | .section-4 { 86 | grid-area: M; 87 | } 88 | .section-5 { 89 | grid-area: R; 90 | } 91 | .section-6 { 92 | grid-area: S; 93 | } 94 | 95 | .section-1 h1 { 96 | margin: 0; 97 | font-size: 1.5in; 98 | font-family: "Paytone One"; 99 | text-align: center; 100 | text-transform: uppercase; 101 | color: #2c2c2c; 102 | letter-spacing: .05em; 103 | text-shadow: 0.04em 0.04em 0px #cdeaf4, 0.07em 0.07em 0px rgba(0, 0, 0, 0.2); 104 | } 105 | .section-1 h1 .tiny { 106 | display: block; 107 | text-shadow: none; 108 | font-size: 0.5em; 109 | text-transform: none; 110 | margin-top: -0.7em; 111 | margin-bottom: -0.7em; 112 | } 113 | .section-1 p { 114 | font-family: "Paytone One"; 115 | width: 100%; 116 | height: auto; 117 | outline: 0.1in dashed #98abb9; 118 | outline-offset: -0.3in; 119 | background-color: #556068; 120 | margin-top: 1in; 121 | -webkit-box-shadow: 0.1in 0.1in 0.1in #000; 122 | color: #ffffffdd; 123 | text-align: justify; 124 | padding: 2.3em; 125 | } 126 | .section-1 a { 127 | color: #fbbd08; 128 | } 129 | 130 | .section-2 p { 131 | float: left; 132 | margin: 0.5in 0.5cm auto 1cm; 133 | width: 22%; 134 | } 135 | .section-2 .card { 136 | display: inline-block; 137 | height: 11cm; 138 | vertical-align: top; 139 | margin-right: 0.8cm; 140 | margin-top: -3cm !important; 141 | } 142 | .section-2 .disclaimer { 143 | position: absolute; 144 | bottom: -0.6em; 145 | right: 0.6em; 146 | color: #aaa; 147 | } 148 | .section-2 .member-cards { 149 | float: right; 150 | } 151 | 152 | .section-3 .content, .section-4 .content, .section-5 .content { 153 | padding: 1cm; 154 | text-align: justify; 155 | } 156 | 157 | .section-5 .content { 158 | margin-top: -2cm; 159 | column-count: 4; 160 | column-gap: 2cm; 161 | column-fill: auto; 162 | padding-bottom: 0.3cm; 163 | padding-top: 0.3cm; 164 | } 165 | .section-5 .content > p:first-of-type { 166 | margin-top: 3cm; 167 | } 168 | 169 | .section-6 .content { 170 | margin-top: -2cm; 171 | column-count: 2; 172 | column-gap: 2cm; 173 | column-fill: auto; 174 | padding: 1cm; 175 | padding-bottom: 0.3cm; 176 | padding-top: 0.3cm; 177 | } 178 | .section-6 .content p { 179 | font-size: 26px; 180 | margin-bottom: 0.2cm; 181 | } 182 | .section-6 .content .references div:first-child { 183 | margin-top: 3cm; 184 | } 185 | 186 | @media screen { 187 | body { 188 | overflow-x: auto; 189 | } 190 | } 191 | -------------------------------------------------------------------------------- /12_presentation_slides.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "When is the State of the Union delivered?" 3 | subtitle: "\u2694
with xaringan and xaringanthemer" 4 | author: "Gina Reynolds" 5 | date: '`r Sys.Date()`' 6 | output: 7 | xaringan::moon_reader: 8 | chakra: libs/remark-latest.min.js 9 | lib_dir: libs 10 | css: xaringan-themer.css 11 | nature: 12 | beforeInit: "https://platform.twitter.com/widgets.js" 13 | highlightStyle: github 14 | highlightLines: true 15 | countIncrementalSlides: false 16 | --- 17 | 18 | ```{r setup, include=FALSE} 19 | options(htmltools.dir.version = FALSE) 20 | library(tidyverse) 21 | ``` 22 | 23 | ```{r, echo=FALSE} 24 | xaringanthemer::solarized_light(t = 80) 25 | knitr::opts_chunk$set(echo = F, warning = F, message = F) 26 | ``` 27 | 28 | 29 | --- 30 | 31 | # Abstract 32 | 33 | - State of the Union addresses are a classic corpus for students of text analysis. 34 | - In this paper you'll see time-in-year by year plots and a model of the timing. 35 | 36 | 37 | --- 38 | 39 | 40 | - Motivation for addressing this question actually comes from Kenneth Benoit who conducted a quick [analysis](https://twitter.com/kenbenoit/status/1088304778088566785) on this question. 41 | 42 | 43 |

Far from unprecedented for a #stateoftheunion #SOTU address to be held in Feb or to be delivered written. And if written, likely to use more sophisticated language! Details in my forthcoming @AJPS_Editor paper with @kmmunger @arthur_spirling. https://t.co/NKhqkjLoM8 pic.twitter.com/7Rb7XLT8FW

— Kenneth Benoit (@kenbenoit) January 24, 2019
44 | 45 | 46 | 47 | --- 48 | 49 | # Introduction 50 | 51 | The 2019 government shutdown had many people wondering, when will US State of the Union address be delivered by the President. Would it be pushed later than what is considered "normal." 52 | 53 | 54 | 55 | --- 56 | 57 | # Literature Review 58 | 59 | 60 | 61 | ```{r, load_refs, echo=FALSE, cache=FALSE} 62 | library(RefManageR) 63 | BibOptions(check.entries = FALSE, 64 | bib.style = "authoryear", 65 | cite.style = 'alphabetic', 66 | style = "markdown", 67 | hyperlink = FALSE, 68 | dashed = FALSE) 69 | myBib <- ReadBib("./literature/bibliography.bib", check = FALSE) 70 | ``` 71 | 72 | The texts of the State of the Union addresses have been studied by scholars including Benoit, Munger and Spirling; they offer an interesting analysis of State of the Union addresses by US presidents, noting that SOTU that are not delivered orally tend to use more complex language. There are several R text analysis packages . These entries are included in the literature/bibliography.bib document that is referenced in the YMAL. 73 | 74 | `r Cite(myBib, c("silge2016tidytext", "benoit2016quanteda", "benoit2018measuring"))` 75 | 76 | > In this section you might write quota a large selection which you will want to indent. 77 | 78 | 79 | --- 80 | 81 | # Theory and Hypotheses 82 | 83 | This analysis was exploratory. It is well known that modern SOTU addresses are delivered early in the year. After plotting the data, what seemed to matter was year of delivery, and if the SOTU followed an election year. We tried to follow the advice in the e-book [The Fundamentals of Data Visualization](https://serialmentor.com/dataviz). 84 | 85 | Data visualization categories from *"The Fundamentals of Data Visualization."* 86 | 87 | Category | Description 88 | -----|------ 89 | Bad | Misrepresents data or confuse 90 | Ugly | Not pleasing 91 | Good | Not bad and not ugly 92 | 93 | 94 | 95 | 96 | --- 97 | 98 | # Data 99 | 100 | Last 8 presidents: 101 | 102 | 103 | ```{r nice-tab} 104 | library(tidyverse) 105 | # load cleaned data 106 | load("data_products/sotu_texts.Rdata") 107 | sotu_texts_mod <- sotu_texts %>% 108 | mutate(president = fct_inorder(president)) %>% 109 | group_by(president) %>% tally() %>% 110 | rename(President = president) %>% 111 | rename(`Number of Addresses` = n) 112 | 113 | knitr::kable(sotu_texts_mod %>% head(8), format = "html") 114 | ``` 115 | 116 | 117 | --- 118 | class: center 119 | 120 | # Analysis 121 | 122 | 123 | --- 124 | 125 | ## Visualization of relationships 126 | 127 | ```{r year, fig.cap = "Timing of state of the union by year. SOTUs that follow election years are colored with blue.", out.width='\\textwidth', fig.align='center'} 128 | knitr::include_graphics("figures/sotu_timing_delivery.png") 129 | ``` 130 | 131 | 132 | 133 | 134 | --- 135 | 136 | 137 | 138 | 139 | 140 | 141 | ```{r regtable_html, results = "asis"} 142 | # load models that have been saved in .Rdata file previously 143 | load("data_products/models.Rdata") 144 | stargazer::stargazer(lateness_by_year, 145 | lateness_following_election, lateness_full, lateness_full_interaction, 146 | dep.var.labels = "Days elapsed since January 1st", 147 | covariate.labels = c("year", "post election", "year*post election"), 148 | title = "Models of time elapsed in year before State of the Union Address", omit.stat = c("all"), 149 | style = "qje", 150 | type = "html") 151 | ``` 152 | 153 | 154 | 155 | 156 | R^2 is `r round(summary(lateness_full_interaction)$r.squared, 3)`. 157 | 158 | --- 159 | 160 | The full model formula with the interaction is: 161 | 162 | 163 | $$ DaysSinceJan1 = $$ 164 | $$\beta_0 + \beta_1YEAR + B_2FollowingElection + B_3Year*FollowingElection + \epsilon $$ 165 | 166 | --- 167 | 168 | ## Visualization 169 | 170 | ```{r, fig.cap = "Timing of state of the union by year. SOTUs that follow election years are colored with blue.", out.width='\\textwidth', fig.align='center'} 171 | # Include the figure that you have saved out in working files 172 | knitr::include_graphics("figures/sotu_timing_model.png") 173 | ``` 174 | 175 | 176 | 177 | 178 | --- 179 | 180 | # Conclusion 181 | 182 | 183 | - State of the Union addresses, in general are being delivered later and later 184 | 185 | -- 186 | 187 | - SOTU addresses are delivered later if they follow an election year 188 | 189 | -- 190 | 191 | - The 2019 State of the Union timing is not a unusual departure from the trend 192 | 193 | 194 | 195 | 196 | --- 197 | 198 | # References 199 | 200 | 201 | 202 | 203 | ```{r, 'refs', results='asis', echo=FALSE} 204 | PrintBibliography(myBib) 205 | ``` 206 | 207 | -------------------------------------------------------------------------------- /12_presentation_slides.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | When is the State of the Union delivered? 5 | 6 | 7 | 8 | 9 | 10 | 11 | 246 | 247 | 248 | 262 | 263 | 281 | 282 | 292 | 293 | 294 | -------------------------------------------------------------------------------- /12_presentation_slides_files/remark-css/default-fonts.css: -------------------------------------------------------------------------------- 1 | @import url(https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz); 2 | @import url(https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic); 3 | @import url(https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700); 4 | 5 | body { font-family: 'Droid Serif', 'Palatino Linotype', 'Book Antiqua', Palatino, 'Microsoft YaHei', 'Songti SC', serif; } 6 | h1, h2, h3 { 7 | font-family: 'Yanone Kaffeesatz'; 8 | font-weight: normal; 9 | } 10 | .remark-code, .remark-inline-code { font-family: 'Source Code Pro', 'Lucida Console', Monaco, monospace; } 11 | -------------------------------------------------------------------------------- /12_presentation_slides_files/remark-css/default.css: -------------------------------------------------------------------------------- 1 | a, a > code { 2 | color: rgb(249, 38, 114); 3 | text-decoration: none; 4 | } 5 | .footnote { 6 | position: absolute; 7 | bottom: 3em; 8 | padding-right: 4em; 9 | font-size: 90%; 10 | } 11 | .remark-code-line-highlighted { background-color: #ffff88; } 12 | 13 | .inverse { 14 | background-color: #272822; 15 | color: #d6d6d6; 16 | text-shadow: 0 0 20px #333; 17 | } 18 | .inverse h1, .inverse h2, .inverse h3 { 19 | color: #f3f3f3; 20 | } 21 | /* Two-column layout */ 22 | .left-column { 23 | color: #777; 24 | width: 20%; 25 | height: 92%; 26 | float: left; 27 | } 28 | .left-column h2:last-of-type, .left-column h3:last-child { 29 | color: #000; 30 | } 31 | .right-column { 32 | width: 75%; 33 | float: right; 34 | padding-top: 1em; 35 | } 36 | .pull-left { 37 | float: left; 38 | width: 47%; 39 | } 40 | .pull-right { 41 | float: right; 42 | width: 47%; 43 | } 44 | .pull-right ~ * { 45 | clear: both; 46 | } 47 | img, video, iframe { 48 | max-width: 100%; 49 | } 50 | blockquote { 51 | border-left: solid 5px lightgray; 52 | padding-left: 1em; 53 | } 54 | .remark-slide table { 55 | margin: auto; 56 | border-top: 1px solid #666; 57 | border-bottom: 1px solid #666; 58 | } 59 | .remark-slide table thead th { border-bottom: 1px solid #ddd; } 60 | th, td { padding: 5px; } 61 | .remark-slide thead, .remark-slide tfoot, .remark-slide tr:nth-child(even) { background: #eee } 62 | 63 | @page { margin: 0; } 64 | @media print { 65 | .remark-slide-scaler { 66 | width: 100% !important; 67 | height: 100% !important; 68 | transform: scale(1) !important; 69 | top: 0 !important; 70 | left: 0 !important; 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # from_raw_data_to_paper_and_presentation 2 | This contains a bare-bones example of how to implement a reproducible workflow using .Rmd files, from raw data to a formatted research paper as well as presentation materials (slides and poster). 3 | 4 | 5 | Link to rendered html: 6 | 7 | 8 | - [01_getting_data.html](https://evamaerey.github.io/from_raw_data_to_paper_and_presentation/01_getting_data.html) 9 | - [02_data_cleaning.html](https://evamaerey.github.io/from_raw_data_to_paper_and_presentation/02_data_cleaning.html) 10 | - [03_analysis.html](https://evamaerey.github.io/from_raw_data_to_paper_and_presentation/03_analysis.html) 11 | - [10_paper.html](https://evamaerey.github.io/from_raw_data_to_paper_and_presentation/10_paper.html) 12 | - [10_paper.pdf](https://evamaerey.github.io/from_raw_data_to_paper_and_presentation/10_paper.pdf) 13 | - [11_poster_professional.html](https://evamaerey.github.io/from_raw_data_to_paper_and_presentation/11_poster_professional.html) 14 | - [11_poster_professional_empty.html](https://evamaerey.github.io/from_raw_data_to_paper_and_presentation/11_poster_professional_empty.html) 15 | - [11_poster_relaxed.html](https://evamaerey.github.io/from_raw_data_to_paper_and_presentation/11_poster_relaxed.html) 16 | - [11_poster_relaxed_empty.html](https://evamaerey.github.io/from_raw_data_to_paper_and_presentation/11_poster_relaxed_empty.html) 17 | - [12_presentation_slides.html](https://evamaerey.github.io/from_raw_data_to_paper_and_presentation/12_presentation_slides.html) 18 | -------------------------------------------------------------------------------- /data_products/models.Rdata: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvaMaeRey/from_raw_data_to_paper_and_presentation/2d23d0513dc98488657b560ad4b26271efe76205/data_products/models.Rdata -------------------------------------------------------------------------------- /data_products/sotu_texts.Rdata: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvaMaeRey/from_raw_data_to_paper_and_presentation/2d23d0513dc98488657b560ad4b26271efe76205/data_products/sotu_texts.Rdata -------------------------------------------------------------------------------- /figure/unnamed-chunk-3-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvaMaeRey/from_raw_data_to_paper_and_presentation/2d23d0513dc98488657b560ad4b26271efe76205/figure/unnamed-chunk-3-1.png -------------------------------------------------------------------------------- /figure/unnamed-chunk-4-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvaMaeRey/from_raw_data_to_paper_and_presentation/2d23d0513dc98488657b560ad4b26271efe76205/figure/unnamed-chunk-4-1.png -------------------------------------------------------------------------------- /figure/unnamed-chunk-5-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvaMaeRey/from_raw_data_to_paper_and_presentation/2d23d0513dc98488657b560ad4b26271efe76205/figure/unnamed-chunk-5-1.png -------------------------------------------------------------------------------- /figure/unnamed-chunk-7-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvaMaeRey/from_raw_data_to_paper_and_presentation/2d23d0513dc98488657b560ad4b26271efe76205/figure/unnamed-chunk-7-1.png -------------------------------------------------------------------------------- /figure/unnamed-chunk-7-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvaMaeRey/from_raw_data_to_paper_and_presentation/2d23d0513dc98488657b560ad4b26271efe76205/figure/unnamed-chunk-7-2.png -------------------------------------------------------------------------------- /figure/unnamed-chunk-7-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvaMaeRey/from_raw_data_to_paper_and_presentation/2d23d0513dc98488657b560ad4b26271efe76205/figure/unnamed-chunk-7-3.png -------------------------------------------------------------------------------- /figure/unnamed-chunk-7-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvaMaeRey/from_raw_data_to_paper_and_presentation/2d23d0513dc98488657b560ad4b26271efe76205/figure/unnamed-chunk-7-4.png -------------------------------------------------------------------------------- /figures/num_speeches_per_pres.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvaMaeRey/from_raw_data_to_paper_and_presentation/2d23d0513dc98488657b560ad4b26271efe76205/figures/num_speeches_per_pres.png -------------------------------------------------------------------------------- /figures/sotu_timing_delivery.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvaMaeRey/from_raw_data_to_paper_and_presentation/2d23d0513dc98488657b560ad4b26271efe76205/figures/sotu_timing_delivery.png -------------------------------------------------------------------------------- /figures/sotu_timing_model.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvaMaeRey/from_raw_data_to_paper_and_presentation/2d23d0513dc98488657b560ad4b26271efe76205/figures/sotu_timing_model.png -------------------------------------------------------------------------------- /from_raw_data_to_paper_and_presentation.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: knitr 13 | LaTeX: pdfLaTeX 14 | -------------------------------------------------------------------------------- /index.bib: -------------------------------------------------------------------------------- 1 | @Manual{R-base, 2 | title = {R: A Language and Environment for Statistical Computing}, 3 | author = {{R Core Team}}, 4 | organization = {R Foundation for Statistical Computing}, 5 | address = {Vienna, Austria}, 6 | year = {2018}, 7 | url = {https://www.R-project.org/}, 8 | } 9 | @Manual{R-pagedown, 10 | title = {pagedown: Paginate the HTML Output of R Markdown with CSS for Print}, 11 | author = {Yihui Xie and Romain Lesur}, 12 | year = {2019}, 13 | note = {R package version 0.1.4}, 14 | url = {https://github.com/rstudio/pagedown}, 15 | } 16 | @Manual{R-xaringan, 17 | title = {xaringan: Presentation Ninja}, 18 | author = {Yihui Xie}, 19 | year = {2019}, 20 | note = {R package version 0.8.14}, 21 | url = {https://github.com/yihui/xaringan}, 22 | } 23 | -------------------------------------------------------------------------------- /libs/remark-css-0.0.1/default-fonts.css: -------------------------------------------------------------------------------- 1 | @import url(https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz); 2 | @import url(https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic); 3 | @import url(https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700); 4 | 5 | body { font-family: 'Droid Serif', 'Palatino Linotype', 'Book Antiqua', Palatino, 'Microsoft YaHei', 'Songti SC', serif; } 6 | h1, h2, h3 { 7 | font-family: 'Yanone Kaffeesatz'; 8 | font-weight: normal; 9 | } 10 | .remark-code, .remark-inline-code { font-family: 'Source Code Pro', 'Lucida Console', Monaco, monospace; } 11 | -------------------------------------------------------------------------------- /libs/remark-css-0.0.1/default.css: -------------------------------------------------------------------------------- 1 | a, a > code { 2 | color: rgb(249, 38, 114); 3 | text-decoration: none; 4 | } 5 | .footnote { 6 | position: absolute; 7 | bottom: 3em; 8 | padding-right: 4em; 9 | font-size: 90%; 10 | } 11 | .remark-code-line-highlighted { background-color: #ffff88; } 12 | 13 | .inverse { 14 | background-color: #272822; 15 | color: #d6d6d6; 16 | text-shadow: 0 0 20px #333; 17 | } 18 | .inverse h1, .inverse h2, .inverse h3 { 19 | color: #f3f3f3; 20 | } 21 | /* Two-column layout */ 22 | .left-column { 23 | color: #777; 24 | width: 20%; 25 | height: 92%; 26 | float: left; 27 | } 28 | .left-column h2:last-of-type, .left-column h3:last-child { 29 | color: #000; 30 | } 31 | .right-column { 32 | width: 75%; 33 | float: right; 34 | padding-top: 1em; 35 | } 36 | .pull-left { 37 | float: left; 38 | width: 47%; 39 | } 40 | .pull-right { 41 | float: right; 42 | width: 47%; 43 | } 44 | .pull-right ~ * { 45 | clear: both; 46 | } 47 | img, video, iframe { 48 | max-width: 100%; 49 | } 50 | blockquote { 51 | border-left: solid 5px lightgray; 52 | padding-left: 1em; 53 | } 54 | .remark-slide table { 55 | margin: auto; 56 | border-top: 1px solid #666; 57 | border-bottom: 1px solid #666; 58 | } 59 | .remark-slide table thead th { border-bottom: 1px solid #ddd; } 60 | th, td { padding: 5px; } 61 | .remark-slide thead, .remark-slide tfoot, .remark-slide tr:nth-child(even) { background: #eee } 62 | 63 | @page { margin: 0; } 64 | @media print { 65 | .remark-slide-scaler { 66 | width: 100% !important; 67 | height: 100% !important; 68 | transform: scale(1) !important; 69 | top: 0 !important; 70 | left: 0 !important; 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /libs/remark-css/default-fonts.css: -------------------------------------------------------------------------------- 1 | @import url(https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz); 2 | @import url(https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic); 3 | @import url(https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700); 4 | 5 | body { font-family: 'Droid Serif', 'Palatino Linotype', 'Book Antiqua', Palatino, 'Microsoft YaHei', 'Songti SC', serif; } 6 | h1, h2, h3 { 7 | font-family: 'Yanone Kaffeesatz'; 8 | font-weight: normal; 9 | } 10 | .remark-code, .remark-inline-code { font-family: 'Source Code Pro', 'Lucida Console', Monaco, monospace; } 11 | -------------------------------------------------------------------------------- /libs/remark-css/default.css: -------------------------------------------------------------------------------- 1 | a, a > code { 2 | color: rgb(249, 38, 114); 3 | text-decoration: none; 4 | } 5 | .footnote { 6 | position: absolute; 7 | bottom: 3em; 8 | padding-right: 4em; 9 | font-size: 90%; 10 | } 11 | .remark-code-line-highlighted { background-color: #ffff88; } 12 | 13 | .inverse { 14 | background-color: #272822; 15 | color: #d6d6d6; 16 | text-shadow: 0 0 20px #333; 17 | } 18 | .inverse h1, .inverse h2, .inverse h3 { 19 | color: #f3f3f3; 20 | } 21 | /* Two-column layout */ 22 | .left-column { 23 | color: #777; 24 | width: 20%; 25 | height: 92%; 26 | float: left; 27 | } 28 | .left-column h2:last-of-type, .left-column h3:last-child { 29 | color: #000; 30 | } 31 | .right-column { 32 | width: 75%; 33 | float: right; 34 | padding-top: 1em; 35 | } 36 | .pull-left { 37 | float: left; 38 | width: 47%; 39 | } 40 | .pull-right { 41 | float: right; 42 | width: 47%; 43 | } 44 | .pull-right ~ * { 45 | clear: both; 46 | } 47 | img, video, iframe { 48 | max-width: 100%; 49 | } 50 | blockquote { 51 | border-left: solid 5px lightgray; 52 | padding-left: 1em; 53 | } 54 | .remark-slide table { 55 | margin: auto; 56 | border-top: 1px solid #666; 57 | border-bottom: 1px solid #666; 58 | } 59 | .remark-slide table thead th { border-bottom: 1px solid #ddd; } 60 | th, td { padding: 5px; } 61 | .remark-slide thead, .remark-slide tfoot, .remark-slide tr:nth-child(even) { background: #eee } 62 | 63 | @page { margin: 0; } 64 | @media print { 65 | .remark-slide-scaler { 66 | width: 100% !important; 67 | height: 100% !important; 68 | transform: scale(1) !important; 69 | top: 0 !important; 70 | left: 0 !important; 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /literature/bibliography.bib: -------------------------------------------------------------------------------- 1 | @article{benoit2018measuring, 2 | title={Measuring and Explaining Political Sophistication through Textual Complexity}, 3 | author={Benoit, Kenneth and Munger, Kevin and Spirling, Arthur}, 4 | journal={Available at SSRN 3062061}, 5 | year={2018} 6 | } 7 | 8 | @article{silge2016tidytext, 9 | title={tidytext: Text mining and analysis using tidy data principles in r}, 10 | author={Silge, Julia and Robinson, David}, 11 | journal={The Journal of Open Source Software}, 12 | volume={1}, 13 | number={3}, 14 | pages={37}, 15 | year={2016} 16 | } 17 | 18 | @article{benoit2016quanteda, 19 | title={quanteda: Quantitative analysis of textual data}, 20 | author={Benoit, Kenneth and Nulty, Paul}, 21 | journal={R package version 0.9}, 22 | volume={8}, 23 | year={2016} 24 | } -------------------------------------------------------------------------------- /packages.bib: -------------------------------------------------------------------------------- 1 | @Manual{R-knitr, 2 | title = {knitr: A General-Purpose Package for Dynamic Report Generation in R}, 3 | author = {Yihui Xie}, 4 | year = {2018}, 5 | note = {R package version 1.21}, 6 | url = {https://CRAN.R-project.org/package=knitr}, 7 | } 8 | @Manual{R-rmarkdown, 9 | title = {rmarkdown: Dynamic Documents for R}, 10 | author = {JJ Allaire and Yihui Xie and Jonathan McPherson and Javier Luraschi and Kevin Ushey and Aron Atkins and Hadley Wickham and Joe Cheng and Winston Chang and Richard Iannone}, 11 | year = {2019}, 12 | note = {R package version 1.11.7}, 13 | url = {https://rmarkdown.rstudio.com}, 14 | } 15 | @Manual{R-xaringan, 16 | title = {xaringan: Presentation Ninja}, 17 | author = {Yihui Xie}, 18 | year = {2019}, 19 | note = {R package version 0.8.14}, 20 | url = {https://github.com/yihui/xaringan}, 21 | } 22 | -------------------------------------------------------------------------------- /raw_data/jan_or_feb_state_of_the_union.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvaMaeRey/from_raw_data_to_paper_and_presentation/2d23d0513dc98488657b560ad4b26271efe76205/raw_data/jan_or_feb_state_of_the_union.png -------------------------------------------------------------------------------- /raw_data/trump_2019_cnn.txt: -------------------------------------------------------------------------------- 1 | Madam Speaker, Mr. Vice President, Members of Congress, the First Lady of the United States, and my fellow Americans: 2 | We meet tonight at a moment of unlimited potential. As we begin a new Congress, I stand here ready to work with you to achieve historic breakthroughs for all Americans. 3 | Millions of our fellow citizens are watching us now, gathered in this great chamber, hoping that we will govern not as two parties but as one Nation. 4 | The agenda I will lay out this evening is not a Republican agenda or a Democrat agenda. It is the agenda of the American people. 5 | Many of us campaigned on the same core promises: to defend American jobs and demand fair trade for American workers; to rebuild and revitalize our Nation's infrastructure; to reduce the price of healthcare and prescription drugs; to create an immigration system that is safe, lawful, modern and secure; and to pursue a foreign policy that puts America's interests first. 6 | There is a new opportunity in American politics, if only we have the courage to seize it. Victory is not winning for our party. Victory is winning for our country. 7 | This year, America will recognize two important anniversaries that show us the majesty of America's mission, and the power of American pride. 8 | In June, we mark 75 years since the start of what General Dwight D. Eisenhower called the Great Crusade -- the Allied liberation of Europe in World War II. On D-Day, June 6, 1944, 15,000 young American men jumped from the sky, and 60,000 more stormed in from the sea, to save our civilization from tyranny. Here with us tonight are three of those heroes: Private First Class Joseph Reilly, Staff Sergeant Irving Locker, and Sergeant Herman Zeitchik. Gentlemen, we salute you. 9 | In 2019, we also celebrate 50 years since brave young pilots flew a quarter of a million miles through space to plant the American flag on the face of the moon. Half a century later, we are joined by one of the Apollo 11 astronauts who planted that flag: Buzz Aldrin. This year, American astronauts will go back to space on American rockets. 10 | In the 20th century, America saved freedom, transformed science, and redefined the middle class standard of living for the entire world to see. Now, we must step boldly and bravely into the next chapter of this great American adventure, and we must create a new standard of living for the 21st century. An amazing quality of life for all of our citizens is within our reach. 11 | We can make our communities safer, our families stronger, our culture richer, our faith deeper, and our middle class bigger and more prosperous than ever before. 12 | But we must reject the politics of revenge, resistance, and retribution -- and embrace the boundless potential of cooperation, compromise, and the common good. 13 | Together, we can break decades of political stalemate. We can bridge old divisions, heal old wounds, build new coalitions, forge new solutions, and unlock the extraordinary promise of America's future. The decision is ours to make. 14 | We must choose between greatness or gridlock, results or resistance, vision or vengeance, incredible progress or pointless destruction. 15 | Tonight, I ask you to choose greatness. 16 | Over the last 2 years, my Administration has moved with urgency and historic speed to confront problems neglected by leaders of both parties over many decades. 17 | In just over 2 years since the election, we have launched an unprecedented economic boom -- a boom that has rarely been seen before. We have created 5.3 million new jobs and importantly added 600,000 new manufacturing jobs -- something which almost everyone said was impossible to do, but the fact is, we are just getting started. 18 | Wages are rising at the fastest pace in decades, and growing for blue collar workers, who I promised to fight for, faster than anyone else. Nearly 5 million Americans have been lifted off food stamps. The United States economy is growing almost twice as fast today as when I took office, and we are considered far and away the hottest economy anywhere in the world. Unemployment has reached the lowest rate in half a century. African-American, Hispanic-American and Asian-American unemployment have all reached their lowest levels ever recorded. Unemployment for Americans with disabilities has also reached an all-time low. More people are working now than at any time in our history --- 157 million. 19 | We passed a massive tax cut for working families and doubled the child tax credit. 20 | We virtually ended the estate, or death, tax on small businesses, ranches, and family farms. 21 | We eliminated the very unpopular Obamacare individual mandate penalty -- and to give critically ill patients access to life-saving cures, we passed right to try. 22 | My Administration has cut more regulations in a short time than any other administration during its entire tenure. Companies are coming back to our country in large numbers thanks to historic reductions in taxes and regulations. 23 | We have unleashed a revolution in American energy -- the United States is now the number one producer of oil and natural gas in the world. And now, for the first time in 65 years, we are a net exporter of energy. 24 | After 24 months of rapid progress, our economy is the envy of the world, our military is the most powerful on earth, and America is winning each and every day. Members of Congress: the State of our Union is strong. Our country is vibrant and our economy is thriving like never before. 25 | On Friday, it was announced that we added another 304,000 jobs last month alone -- almost double what was expected. An economic miracle is taking place in the United States -- and the only thing that can stop it are foolish wars, politics, or ridiculous partisan investigations. 26 | If there is going to be peace and legislation, there cannot be war and investigation. It just doesn't work that way! 27 | We must be united at home to defeat our adversaries abroad. 28 | This new era of cooperation can start with finally confirming the more than 300 highly qualified nominees who are still stuck in the Senate -- some after years of waiting. The Senate has failed to act on these nominations, which is unfair to the nominees and to our country. 29 | Now is the time for bipartisan action. Believe it or not, we have already proven that it is possible. 30 | In the last Congress, both parties came together to pass unprecedented legislation to confront the opioid crisis, a sweeping new Farm Bill, historic VA reforms, and after four decades of rejection, we passed VA Accountability so we can finally terminate those who mistreat our wonderful veterans. 31 | And just weeks ago, both parties united for groundbreaking criminal justice reform. Last year, I heard through friends the story of Alice Johnson. I was deeply moved. In 1997, Alice was sentenced to life in prison as a first-time non-violent drug offender. Over the next two decades, she became a prison minister, inspiring others to choose a better path. She had a big impact on that prison population -- and far beyond. 32 | Alice's story underscores the disparities and unfairness that can exist in criminal sentencing -- and the need to remedy this injustice. She served almost 22 years and had expected to be in prison for the rest of her life. 33 | In June, I commuted Alice's sentence -- and she is here with us tonight. Alice, thank you for reminding us that we always have the power to shape our own destiny. 34 | When I saw Alice's beautiful family greet her at the prison gates, hugging and kissing and crying and laughing, I knew I did the right thing. 35 | Inspired by stories like Alice's, my Administration worked closely with members of both parties to sign the First Step Act into law. This legislation reformed sentencing laws that have wrongly and disproportionately harmed the African-American community. The First Step Act gives non-violent offenders the chance to re-enter society as productive, law-abiding citizens. Now, States across the country are following our lead. America is a Nation that believes in redemption. 36 | We are also joined tonight by Matthew Charles from Tennessee. In 1996, at age 30, Matthew was sentenced to 35 years for selling drugs and related offenses. Over the next two decades, he completed more than 30 Bible studies, became a law clerk, and mentored fellow inmates. Now, Matthew is the very first person to be released from prison under the First Step Act. Matthew, on behalf of all Americans: welcome home. 37 | As we have seen, when we are united, we can make astonishing strides for our country. Now, Republicans and Democrats must join forces again to confront an urgent national crisis. 38 | The Congress has 10 days left to pass a bill that will fund our Government, protect our homeland, and secure our southern border. 39 | Now is the time for the Congress to show the world that America is committed to ending illegal immigration and putting the ruthless coyotes, cartels, drug dealers, and human traffickers out of business. 40 | As we speak, large, organized caravans are on the march to the United States. We have just heard that Mexican cities, in order to remove the illegal immigrants from their communities, are getting trucks and buses to bring them up to our country in areas where there is little border protection. I have ordered another 3,750 troops to our southern border to prepare for the tremendous onslaught. 41 | This is a moral issue. The lawless state of our southern border is a threat to the safety, security, and financial well‑being of all Americans. We have a moral duty to create an immigration system that protects the lives and jobs of our citizens. This includes our obligation to the millions of immigrants living here today, who followed the rules and respected our laws. Legal immigrants enrich our Nation and strengthen our society in countless ways. I want people to come into our country, but they have to come in legally. 42 | Tonight, I am asking you to defend our very dangerous southern border out of love and devotion to our fellow citizens and to our country. 43 | No issue better illustrates the divide between America's working class and America's political class than illegal immigration. Wealthy politicians and donors push for open borders while living their lives behind walls and gates and guards. 44 | Meanwhile, working class Americans are left to pay the price for mass illegal migration -- reduced jobs, lower wages, overburdened schools and hospitals, increased crime, and a depleted social safety net. 45 | Tolerance for illegal immigration is not compassionate -- it is cruel. One in three women is sexually assaulted on the long journey north. Smugglers use migrant children as human pawns to exploit our laws and gain access to our country. 46 | Human traffickers and sex traffickers take advantage of the wide open areas between our ports of entry to smuggle thousands of young girls and women into the United States and to sell them into prostitution and modern-day slavery. 47 | Tens of thousands of innocent Americans are killed by lethal drugs that cross our border and flood into our cities -- including meth, heroin, cocaine, and fentanyl. 48 | The savage gang, MS-13, now operates in 20 different American States, and they almost all come through our southern border. Just yesterday, an MS-13 gang member was taken into custody for a fatal shooting on a subway platform in New York City. We are removing these gang members by the thousands, but until we secure our border they're going to keep streaming back in. 49 | Year after year, countless Americans are murdered by criminal illegal aliens. 50 | I've gotten to know many wonderful Angel Moms, Dads, and families -- no one should ever have to suffer the horrible heartache they have endured. 51 | Here tonight is Debra Bissell. Just three weeks ago, Debra's parents, Gerald and Sharon, were burglarized and shot to death in their Reno, Nevada, home by an illegal alien. They were in their eighties and are survived by four children, 11 grandchildren, and 20 great-grandchildren. Also here tonight are Gerald and Sharon's granddaughter, Heather, and great‑granddaughter, Madison. 52 | To Debra, Heather, Madison, please stand: few can understand your pain. But I will never forget, and I will fight for the memory of Gerald and Sharon, that it should never happen again. 53 | Not one more American life should be lost because our Nation failed to control its very dangerous border. 54 | In the last 2 years, our brave ICE officers made 266,000 arrests of criminal aliens, including those charged or convicted of nearly 100,000 assaults, 30,000 sex crimes, and 4,000 killings. 55 | We are joined tonight by one of those law enforcement heroes: ICE Special Agent Elvin Hernandez. When Elvin was a boy, he and his family legally immigrated to the United States from the Dominican Republic. At the age of eight, Elvin told his dad he wanted to become a Special Agent. Today, he leads investigations into the scourge of international sex trafficking. Elvin says: "If I can make sure these young girls get their justice, I've done my job." Thanks to his work and that of his colleagues, more than 300 women and girls have been rescued from horror and more than 1,500 sadistic traffickers have been put behind bars in the last year. 56 | Special Agent Hernandez, please stand: We will always support the brave men and women of Law Enforcement -- and I pledge to you tonight that we will never abolish our heroes from ICE. 57 | My Administration has sent to the Congress a commonsense proposal to end the crisis on our southern border. 58 | It includes humanitarian assistance, more law enforcement, drug detection at our ports, closing loopholes that enable child smuggling, and plans for a new physical barrier, or wall, to secure the vast areas between our ports of entry. In the past, most of the people in this room voted for a wall -- but the proper wall never got built. I'll get it built. 59 | This is a smart, strategic, see-through steel barrier -- not just a simple concrete wall. It will be deployed in the areas identified by border agents as having the greatest need, and as these agents will tell you, where walls go up, illegal crossings go way down. 60 | San Diego used to have the most illegal border crossings in the country. In response, and at the request of San Diego residents and political leaders, a strong security wall was put in place. This powerful barrier almost completely ended illegal crossings. 61 | The border city of El Paso, Texas, used to have extremely high rates of violent crime -- one of the highest in the country, and considered one of our Nation's most dangerous cities. Now, with a powerful barrier in place, El Paso is one of our safest cities. 62 | Simply put, walls work and walls save lives. So let's work together, compromise, and reach a deal that will truly make America safe. 63 | As we work to defend our people's safety, we must also ensure our economic resurgence continues at a rapid pace. 64 | No one has benefitted more from our thriving economy than women, who have filled 58 percent of the new jobs created in the last year. All Americans can be proud that we have more women in the workforce than ever before -- and exactly one century after the Congress passed the Constitutional amendment giving women the right to vote, we also have more women serving in the Congress than ever before. 65 | As part of our commitment to improving opportunity for women everywhere, this Thursday we are launching the first ever Government-wide initiative focused on economic empowerment for women in developing countries. 66 | To build on our incredible economic success, one priority is paramount -- reversing decades of calamitous trade policies. 67 | We are now making it clear to China that after years of targeting our industries, and stealing our intellectual property, the theft of American jobs and wealth has come to an end. 68 | Therefore, we recently imposed tariffs on $250 billion of Chinese goods -- and now our Treasury is receiving billions of dollars a month from a country that never gave us a dime. But I don't blame China for taking advantage of us -- I blame our leaders and representatives for allowing this travesty to happen. I have great respect for President Xi, and we are now working on a new trade deal with China. But it must include real, structural change to end unfair trade practices, reduce our chronic trade deficit, and protect American jobs. 69 | Another historic trade blunder was the catastrophe known as NAFTA. 70 | I have met the men and women of Michigan, Ohio, Pennsylvania, Indiana, New Hampshire, and many other States whose dreams were shattered by NAFTA. For years, politicians promised them they would negotiate for a better deal. But no one ever tried -- until now. 71 | Our new U.S.-Mexico-Canada Agreement -- or USMCA -- will replace NAFTA and deliver for American workers: bringing back our manufacturing jobs, expanding American agriculture, protecting intellectual property, and ensuring that more cars are proudly stamped with four beautiful words: made in the USA. 72 | Tonight, I am also asking you to pass the United States Reciprocal Trade Act, so that if another country places an unfair tariff on an American product, we can charge them the exact same tariff on the same product that they sell to us. 73 | Both parties should be able to unite for a great rebuilding of America's crumbling infrastructure. 74 | I know that the Congress is eager to pass an infrastructure bill -- and I am eager to work with you on legislation to deliver new and important infrastructure investment, including investments in the cutting edge industries of the future. This is not an option. This is a necessity. 75 | The next major priority for me, and for all of us, should be to lower the cost of healthcare and prescription drugs -- and to protect patients with pre-existing conditions. 76 | Already, as a result of my Administration's efforts, in 2018 drug prices experienced their single largest decline in 46 years. 77 | But we must do more. It is unacceptable that Americans pay vastly more than people in other countries for the exact same drugs, often made in the exact same place. This is wrong, unfair, and together we can stop it. 78 | I am asking the Congress to pass legislation that finally takes on the problem of global freeloading and delivers fairness and price transparency for American patients. We should also require drug companies, insurance companies, and hospitals to disclose real prices to foster competition and bring costs down. 79 | No force in history has done more to advance the human condition than American freedom. In recent years we have made remarkable progress in the fight against HIV and AIDS. Scientific breakthroughs have brought a once-distant dream within reach. My budget will ask Democrats and Republicans to make the needed commitment to eliminate the HIV epidemic in the United States within 10 years. Together, we will defeat AIDS in America. 80 | Tonight, I am also asking you to join me in another fight that all Americans can get behind: the fight against childhood cancer. 81 | Joining Melania in the gallery this evening is a very brave 10-year-old girl, Grace Eline. Every birthday since she was 4, Grace asked her friends to donate to St. Jude Children's Research Hospital. She did not know that one day she might be a patient herself. Last year, Grace was diagnosed with brain cancer. Immediately, she began radiation treatment. At the same time, she rallied her community and raised more than $40,000 for the fight against cancer. When Grace completed treatment last fall, her doctors and nurses cheered with tears in their eyes as she hung up a poster that read: "Last Day of Chemo." Grace -- you are an inspiration to us all. 82 | Many childhood cancers have not seen new therapies in decades. My budget will ask the Congress for $500 million over the next 10 years to fund this critical life-saving research. 83 | To help support working parents, the time has come to pass school choice for America's children. I am also proud to be the first President to include in my budget a plan for nationwide paid family leave -- so that every new parent has the chance to bond with their newborn child. 84 | There could be no greater contrast to the beautiful image of a mother holding her infant child than the chilling displays our Nation saw in recent days. Lawmakers in New York cheered with delight upon the passage of legislation that would allow a baby to be ripped from the mother's womb moments before birth. These are living, feeling, beautiful babies who will never get the chance to share their love and dreams with the world. And then, we had the case of the Governor of Virginia where he basically stated he would execute a baby after birth. 85 | To defend the dignity of every person, I am asking the Congress to pass legislation to prohibit the late-term abortion of children who can feel pain in the mother's womb. 86 | Let us work together to build a culture that cherishes innocent life. And let us reaffirm a fundamental truth: all children -- born and unborn -- are made in the holy image of God. 87 | The final part of my agenda is to protect America's National Security. 88 | Over the last 2 years, we have begun to fully rebuild the United States Military -- with $700 billion last year and $716 billion this year. We are also getting other nations to pay their fair share. For years, the United States was being treated very unfairly by NATO -- but now we have secured a $100 billion increase in defense spending from NATO allies. 89 | As part of our military build-up, the United States is developing a state-of-the-art Missile Defense System. 90 | Under my Administration, we will never apologize for advancing America's interests. 91 | For example, decades ago the United States entered into a treaty with Russia in which we agreed to limit and reduce our missile capabilities. While we followed the agreement to the letter, Russia repeatedly violated its terms. That is why I announced that the United States is officially withdrawing from the Intermediate-Range Nuclear Forces Treaty, or INF Treaty. 92 | Perhaps we can negotiate a different agreement, adding China and others, or perhaps we can't --- in which case, we will outspend and out-innovate all others by far. 93 | As part of a bold new diplomacy, we continue our historic push for peace on the Korean Peninsula. Our hostages have come home, nuclear testing has stopped, and there has not been a missile launch in 15 months. If I had not been elected President of the United States, we would right now, in my opinion, be in a major war with North Korea with potentially millions of people killed. Much work remains to be done, but my relationship with Kim Jong Un is a good one. And Chairman Kim and I will meet again on February 27 and 28 in Vietnam. 94 | Two weeks ago, the United States officially recognized the legitimate government of Venezuela, and its new interim President, Juan Guaido. 95 | We stand with the Venezuelan people in their noble quest for freedom -- and we condemn the brutality of the Maduro regime, whose socialist policies have turned that nation from being the wealthiest in South America into a state of abject poverty and despair. 96 | Here, in the United States, we are alarmed by new calls to adopt socialism in our country. America was founded on liberty and independence --- not government coercion, domination, and control. We are born free, and we will stay free. Tonight, we renew our resolve that America will never be a socialist country. 97 | One of the most complex set of challenges we face is in the Middle East. 98 | Our approach is based on principled realism -- not discredited theories that have failed for decades to yield progress. For this reason, my Administration recognized the true capital of Israel -- and proudly opened the American Embassy in Jerusalem. 99 | Our brave troops have now been fighting in the Middle East for almost 19 years. In Afghanistan and Iraq, nearly 7,000 American heroes have given their lives. More than 52,000 Americans have been badly wounded. We have spent more than $7 trillion in the Middle East. 100 | As a candidate for President, I pledged a new approach. Great nations do not fight endless wars. 101 | When I took office, ISIS controlled more than 20,000 square miles in Iraq and Syria. Today, we have liberated virtually all of that territory from the grip of these bloodthirsty killers. 102 | Now, as we work with our allies to destroy the remnants of ISIS, it is time to give our brave warriors in Syria a warm welcome home. 103 | I have also accelerated our negotiations to reach a political settlement in Afghanistan. Our troops have fought with unmatched valor -- and thanks to their bravery, we are now able to pursue a political solution to this long and bloody conflict. 104 | In Afghanistan, my Administration is holding constructive talks with a number of Afghan groups, including the Taliban. As we make progress in these negotiations, we will be able to reduce our troop presence and focus on counter-terrorism. We do not know whether we will achieve an agreement -- but we do know that after two decades of war, the hour has come to at least try for peace. 105 | Above all, friend and foe alike must never doubt this Nation's power and will to defend our people. Eighteen years ago, terrorists attacked the USS Cole -- and last month American forces killed one of the leaders of the attack. 106 | We are honored to be joined tonight by Tom Wibberley, whose son, Navy Seaman Craig Wibberley, was one of the 17 sailors we tragically lost. Tom: we vow to always remember the heroes of the USS Cole. 107 | My Administration has acted decisively to confront the world's leading state sponsor of terror: the radical regime in Iran. 108 | To ensure this corrupt dictatorship never acquires nuclear weapons, I withdrew the United States from the disastrous Iran nuclear deal. And last fall, we put in place the toughest sanctions ever imposed on a country. 109 | We will not avert our eyes from a regime that chants death to America and threatens genocide against the Jewish people. We must never ignore the vile poison of anti-Semitism, or those who spread its venomous creed. With one voice, we must confront this hatred anywhere and everywhere it occurs. 110 | Just months ago, 11 Jewish-Americans were viciously murdered in an anti-semitic attack on the Tree of Life Synagogue in Pittsburgh. SWAT Officer Timothy Matson raced into the gunfire and was shot seven times chasing down the killer. Timothy has just had his 12th surgery -- but he made the trip to be here with us tonight. Officer Matson: we are forever grateful for your courage in the face of evil. 111 | Tonight, we are also joined by Pittsburgh survivor Judah Samet. He arrived at the synagogue as the massacre began. But not only did Judah narrowly escape death last fall -- more than seven decades ago, he narrowly survived the Nazi concentration camps. Today is Judah's 81st birthday. Judah says he can still remember the exact moment, nearly 75 years ago, after 10 months in a concentration camp, when he and his family were put on a train, and told they were going to another camp. Suddenly the train screeched to a halt. A soldier appeared. Judah's family braced for the worst. Then, his father cried out with joy: "It's the Americans." 112 | A second Holocaust survivor who is here tonight, Joshua Kaufman, was a prisoner at Dachau Concentration Camp. He remembers watching through a hole in the wall of a cattle car as American soldiers rolled in with tanks. "To me," Joshua recalls, "the American soldiers were proof that God exists, and they came down from the sky." 113 | I began this evening by honoring three soldiers who fought on D-Day in the Second World War. One of them was Herman Zeitchik. But there is more to Herman's story. A year after he stormed the beaches of Normandy, Herman was one of those American soldiers who helped liberate Dachau. He was one of the Americans who helped rescue Joshua from that hell on earth. Almost 75 years later, Herman and Joshua are both together in the gallery tonight -- seated side-by-side, here in the home of American freedom. Herman and Joshua: your presence this evening honors and uplifts our entire Nation. 114 | When American soldiers set out beneath the dark skies over the English Channel in the early hours of D-Day, 1944, they were just young men of 18 and 19, hurtling on fragile landing craft toward the most momentous battle in the history of war. 115 | They did not know if they would survive the hour. They did not know if they would grow old. But they knew that America had to prevail. Their cause was this Nation, and generations yet unborn. 116 | Why did they do it? They did it for America -- they did it for us. 117 | Everything that has come since -- our triumph over communism, our giant leaps of science and discovery, our unrivaled progress toward equality and justice -- all of it is possible thanks to the blood and tears and courage and vision of the Americans who came before. 118 | Think of this Capitol -- think of this very chamber, where lawmakers before you voted to end slavery, to build the railroads and the highways, to defeat fascism, to secure civil rights, to face down an evil empire. 119 | Here tonight, we have legislators from across this magnificent republic. You have come from the rocky shores of Maine and the volcanic peaks of Hawaii; from the snowy woods of Wisconsin and the red deserts of Arizona; from the green farms of Kentucky and the golden beaches of California. Together, we represent the most extraordinary Nation in all of history. 120 | What will we do with this moment? How will we be remembered? 121 | I ask the men and women of this Congress: Look at the opportunities before us! Our most thrilling achievements are still ahead. Our most exciting journeys still await. Our biggest victories are still to come. We have not yet begun to dream. 122 | We must choose whether we are defined by our differences -- or whether we dare to transcend them. 123 | We must choose whether we will squander our inheritance -- or whether we will proudly declare that we are Americans. We do the incredible. We defy the impossible. We conquer the unknown. 124 | This is the time to re-ignite the American imagination. This is the time to search for the tallest summit, and set our sights on the brightest star. This is the time to rekindle the bonds of love and loyalty and memory that link us together as citizens, as neighbors, as patriots. 125 | This is our future -- our fate -- and our choice to make. I am asking you to choose greatness. 126 | No matter the trials we face, no matter the challenges to come, we must go forward together. 127 | We must keep America first in our hearts. We must keep freedom alive in our souls. And we must always keep faith in America's destiny -- that one Nation, under God, must be the hope and the promise and the light and the glory among all the nations of the world! 128 | Thank you. God Bless You, God Bless America, and good night! -------------------------------------------------------------------------------- /xaringan-themer.css: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------- 2 | * 3 | * !! This file was generated by xaringanthemer !! 4 | * 5 | * Changes made to this file directly will be overwritten 6 | * if you used xaringanthemer in your xaringan slides Rmd 7 | * 8 | * Issues or likes? 9 | * - https://github.com/gadenbuie/xaringanthemer 10 | * - https://www.garrickadenbuie.com 11 | * 12 | * Need help? Try: 13 | * - vignette(package = "xaringanthemer") 14 | * - ?xaringanthemer::write_xaringan_theme 15 | * - xaringan wiki: https://github.com/yihui/xaringan/wiki 16 | * - remarkjs wiki: https://github.com/gnab/remark/wiki 17 | * 18 | * ------------------------------------------------------- */ 19 | @import url(https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic); 20 | @import url(https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz); 21 | @import url(https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700); 22 | 23 | 24 | body { 25 | font-family: 'Droid Serif', 'Palatino Linotype', 'Book Antiqua', Palatino, 'Microsoft YaHei', 'Songti SC', serif; 26 | font-weight: normal; 27 | color: #657b83; 28 | } 29 | h1, h2, h3 { 30 | font-family: 'Yanone Kaffeesatz'; 31 | font-weight: normal; 32 | color: #dc322f; 33 | } 34 | .remark-slide-content { 35 | background-color: #fdf6e3; 36 | font-size: 80; 37 | 38 | 39 | 40 | padding: 1em 4em 1em 4em; 41 | } 42 | .remark-slide-content h1 { 43 | font-size: 55px; 44 | } 45 | .remark-slide-content h2 { 46 | font-size: 45px; 47 | } 48 | .remark-slide-content h3 { 49 | font-size: 35px; 50 | } 51 | .remark-code, .remark-inline-code { 52 | font-family: 'Source Code Pro', 'Lucida Console', Monaco, monospace; 53 | } 54 | .remark-code { 55 | font-size: 0.9em; 56 | } 57 | .remark-inline-code { 58 | font-size: 1em; 59 | color: #6c71c4; 60 | 61 | 62 | } 63 | .remark-slide-number { 64 | color: #93a1a1; 65 | opacity: 1; 66 | font-size: 0.9em; 67 | } 68 | strong{color:#d33682;} 69 | a, a > code { 70 | color: #b58900; 71 | text-decoration: none; 72 | } 73 | .footnote { 74 | 75 | position: absolute; 76 | bottom: 3em; 77 | padding-right: 4em; 78 | font-size: 0.9em; 79 | } 80 | .remark-code-line-highlighted { 81 | background-color: #268bd240; 82 | } 83 | .inverse { 84 | background-color: #002b36; 85 | color: #fdf6e3; 86 | 87 | } 88 | .inverse h1, .inverse h2, .inverse h3 { 89 | color: #fdf6e3; 90 | } 91 | .title-slide, .title-slide h1, .title-slide h2, .title-slide h3 { 92 | color: #fdf6e3; 93 | } 94 | .title-slide { 95 | background-color: #002b36; 96 | 97 | 98 | 99 | } 100 | .title-slide .remark-slide-number { 101 | display: none; 102 | } 103 | /* Two-column layout */ 104 | .left-column { 105 | width: 20%; 106 | height: 92%; 107 | float: left; 108 | } 109 | .left-column h2, .left-column h3 { 110 | color: #93a1a1; 111 | } 112 | .left-column h2:last-of-type, .left-column h3:last-child { 113 | color: #586e75; 114 | } 115 | .right-column { 116 | width: 75%; 117 | float: right; 118 | padding-top: 1em; 119 | } 120 | .pull-left { 121 | float: left; 122 | width: 47%; 123 | } 124 | .pull-right { 125 | float: right; 126 | width: 47%; 127 | } 128 | .pull-right ~ * { 129 | clear: both; 130 | } 131 | img, video, iframe { 132 | max-width: 100%; 133 | } 134 | blockquote { 135 | border-left: solid 5px #cb4b16; 136 | padding-left: 1em; 137 | } 138 | .remark-slide table { 139 | margin: auto; 140 | border-top: 1px solid #839496; 141 | border-bottom: 1px solid #839496; 142 | } 143 | .remark-slide table thead th { border-bottom: 1px solid #839496; } 144 | th, td { padding: 5px; } 145 | .remark-slide thead, .remark-slide tfoot, .remark-slide tr:nth-child(even) { background: #eee8d5 } 146 | table.dataTable tbody { 147 | background-color: #fdf6e3; 148 | color: #657b83; 149 | } 150 | table.dataTable.display tbody tr.odd { 151 | background-color: #fdf6e3; 152 | } 153 | table.dataTable.display tbody tr.even { 154 | background-color: #eee8d5; 155 | } 156 | table.dataTable.hover tbody tr:hover, table.dataTable.display tbody tr:hover { 157 | background-color: rgba(255, 255, 255, 0.5); 158 | } 159 | .dataTables_wrapper .dataTables_length, .dataTables_wrapper .dataTables_filter, .dataTables_wrapper .dataTables_info, .dataTables_wrapper .dataTables_processing, .dataTables_wrapper .dataTables_paginate { 160 | color: #657b83; 161 | } 162 | .dataTables_wrapper .dataTables_paginate .paginate_button { 163 | color: #657b83 !important; 164 | } 165 | 166 | @page { margin: 0; } 167 | @media print { 168 | .remark-slide-scaler { 169 | width: 100% !important; 170 | height: 100% !important; 171 | transform: scale(1) !important; 172 | top: 0 !important; 173 | left: 0 !important; 174 | } 175 | } 176 | --------------------------------------------------------------------------------