mycorpus <- subset(inaugCorpus, Year>1900)
mydict <-
dictionary(list(christmas=c("Christmas", "Santa", "holiday"),
opposition=c("Opposition", "reject", "notincorpus"),
taxing="taxing",
taxation="taxation",
taxregex="tax*",
country="united states"))
dfm(mycorpus, dictionary=mydict)
# import the Laver-Garry dictionary from http://bit.ly/1FH2nvf
lgdict <- dictionary(file="~/Dropbox/QUANTESS/dictionaries/Misc Provalis/LaverGarry.cat",
format="wordstat")
dfm(inaugTexts, dictionary=lgdict)
# import a LIWC formatted dictionary
liwcdict <- dictionary(file = "~/Dropbox/QUANTESS/dictionaries/LIWC/LIWC2001_English.dic",
format = "LIWC")
dfm(inaugTexts, dictionary=liwcdict)
Run the code above in your browser using DataLab