# NOT RUN {
# compare Trump v. Obama speeches
prescorpus <- corpus_subset(data_corpus_inaugural,
President %in% c("Obama", "Trump"))
presdfm <- dfm(prescorpus, groups = "President", remove = stopwords("english"),
remove_punct = TRUE)
result <- textstat_keyness(presdfm, target = "Trump")
# plot estimated word keyness
textplot_keyness(result)
textplot_keyness(result, show_reference = FALSE)
# }
Run the code above in your browser using DataLab