-
Notifications
You must be signed in to change notification settings - Fork 41
/
Copy pathREADME.Rmd
49 lines (36 loc) · 1.33 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
---
output:
github_document:
df_print: kable
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r setup, include = FALSE}
knitr::opts_chunk$set(
echo = FALSE,
collapse = TRUE,
comment = "#>"
)
library(tidyverse)
```
# resist_oped
🕵🏽
♀️ Identifying the author behind New York Time's op-ed from [*inside the Trump White House*](https://www.nytimes.com/2018/09/05/opinion/trump-white-house-anonymous-resistance.html).
```{r}
## corr matrix
mat <- readRDS("data/mat.rds")
## plot estimates
est <- cor(t(mat))[, "op-ed"] %>% sort()
```
I compared the paragraphs of the op-ed to tweets posted to timelines by members of the Cabinet. Here's what I found:
<p style="align:center"><img src="plot.png"/></p>
## Method
I've written an [explanation post](resist-oped-text-similarity.md), which I expect to publish at TBD outlet.
## Code/Estimates
See the [analysis](R/01-features.R) (to replicate, btw, start here as well) and [visualization](R/02-plot.R) code.
Download the [raw estimates here](estimates.csv) or view the results below:
```{r}
## print matrix
results <- cor(t(mat))[, "op-ed"] %>% sort(decreasing = TRUE) %>% data.frame(author = names(.), r = ., stringsAsFactors = FALSE, row.names = NULL) %>% `names<-`(c("author", "r"))
write.csv(results, "estimates.csv", row.names = FALSE)
results
```