
Get or set various settings in the corpus for the treatment of texts, such as rules for stemming, stopwords, collocations, etc.
Get the settings from a which a dfm was created
settings(x, ...)## S3 method for class 'default':
settings(x = NULL, ...)
## S3 method for class 'corpus':
settings(x, field = NULL, ...)
settings(x, field) <- value
## S3 method for class 'dfm':
settings(x, ...)
## S3 method for class 'settings':
print(x, ...)
settings(x)
query the corps settingssettings(x, field) <-
update the corpus settings for field
settings()
with no arguments returns a list of system default settings.settings(inaugCorpus, "stopwords")
(tempdfm <- dfm(subset(inaugCorpus, Year>1980), verbose=FALSE))
(tempdfmSW <- dfm(subset(inaugCorpus, Year>1980),
ignoredFeatures=stopwords("english"), verbose=FALSE))
settings(inaugCorpus, "stopwords") <- TRUE
tempdfm <- dfm(inaugCorpus, stem=TRUE, verbose=FALSE)
settings(tempdfm)
Run the code above in your browser using DataLab