# plot the features (without stopwords) from Obama's two inaugural addresses
mydfm <- dfm(subset(inaugCorpus, President=="Obama"), verbose = FALSE,
ignoredFeatures = stopwords("english"))
plot(mydfm)
# plot in colors with some additional options passed to wordcloud
plot(mydfm, random.color = TRUE, rot.per = .25, colors = sample(colors()[2:128], 5))
# comparison plot of Irish government vs opposition
govtopp <- factor(ifelse(ie2010Corpus[, "party"] %in% c("FF", "Green"), "Govt", "Opp"))
govtoppDfm <- dfm(ie2010Corpus, groups = govtopp, verbose = FALSE)
plot(tfidf(govtoppDfm), comparison = TRUE)
# compare to non-tf-idf version
plot(sideDfm, comparison = TRUE)
Run the code above in your browser using DataLab