Usage
df2tm_corpus(text.var, grouping.var = NULL, demographic.vars, ...)
tm2qdap(x)
tm_corpus2wfm(tm.corpus, col1 = "docs", col2 = "text", ...)
tm_corpus2df(tm.corpus, col1 = "docs", col2 = "text", sent.split = TRUE,
...)
tdm(text.var, grouping.var = NULL, vowel.check = TRUE, ...)
dtm(text.var, grouping.var = NULL, vowel.check = TRUE, ...)
polarity_frame(positives, negatives, pos.weights = 1, neg.weights = -1)
Arguments
text.var
The text variable or a wfm
object. grouping.var
The grouping variables. Default NULL
generates
one word list for all text. Also takes a single grouping variable or a list
of 1 or more grouping variables.
demographic.vars
Additional demographic information about the grouping
variables. This is a data.frame, list of equal length vectors, or a single
vector corresponding to the grouping variable/text variable. This
information will be mapped to the DMetaData in the
col1
Name for column 1 (the vector elements).
col2
Name for column 2 (the names of the vectors).
sent.split
logical. If TRUE
the text variable sentences will
be split into individual rows.
vowel.check
logical. Should terms without vowels be remove?
positives
A character vector of positive words.
negatives
A character vector of negative words.
pos.weights
A vector of weights to weight each positive word by.
Length must be equal to length of postives
or length 1 (if 1 weight
will be recycled).
neg.weights
A vector of weights to weight each negative word by.
Length must be equal to length of negatives
or length 1 (if 1 weight
will be recycled).