mydfm <- dfm(subset(inaugCorpus, Year>1980))
mydfmSW <- dfm(subset(inaugCorpus, Year>1980), ignoredFeatures=stopwords("english"))
results <- data.frame(TTR = lexdiv(mydfm, "TTR"),
CTTR = lexdiv(mydfm, "CTTR"),
U = lexdiv(mydfm, "U"),
TTRs = lexdiv(mydfmSW, "TTR"),
CTTRs = lexdiv(mydfmSW, "CTTR"),
Us = lexdiv(mydfmSW, "U"))
results
cor(results)
t(lexdiv(mydfmSW, "Maas"))
Run the code above in your browser using DataLab