# NOT RUN {
period <- ifelse(docvars(data_corpus_inaugural, "Year") < 1945, "pre-war", "post-war")
dfmat <- dfm(data_corpus_inaugural, groups = period)
tstat <- textstat_keyness(dfmat)
textstat_select(tstat, 'america*')
# }
Run the code above in your browser using DataLab