rodham: rodham: Hillary Rodham Clinton emails

Description Dataset Functions Examples

Description

rodham: Hillary Rodham Clinton emails

Dataset

Functions

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
## Not run: 
# get emails from internal data set
data("emails")

# build graph
edges <- edges_emails(emails)
g <- igraph::graph.data.frame(edges)
plot(g)

# plot communities
cm <- igraph::walktrap.community(g)
plot(cm, g)

# get emails content
# get extractor to extract content from emails
ext <- get_xpdf()

dir.create("./emails") # create folder to store extracted content

# get emails released in august
aug_emails <- get_emails(release = "August", save.dir = "./emails",
                         extractor = ext)

# alternatively
# download emails as zip then extract
download_emails("August") # download

dir.create("emails_pdf") # create directory where to extract pdf emails to

unzip("August.zip", exdir = "./emails_pdf")

dir <- "emails_text"

dir.create(dir)

# extract emails to created directory
extract_emails("emails_pdf", save.dir = dir, ext = ext)

# laod all emails
hrc_emails <- load_emails(dir)

class(hrc_emails)

# methods
dates <- get_date(hrc_emails)
communication <- get_com(hrc_emails)
cont <- get_content(hrc_emails) # get actual email content

cont <- clean_content(cont) # clean content see help

# tidy content
cont <- tidy_emails(cont)
head(cont)

## End(Not run)

rodham documentation built on July 18, 2017, 5:01 p.m.

Search within the rodham package
Search all R packages, documentation and source code