Learn R Programming

qdap (version 2.2.1)

df2tm_corpus: Deprecated qdap Functions

Description

df2tm_corpus - Convert a qdap dataframe to a tm package Corpus. tm2qdap - Convert the tm package's TermDocumentMatrix/DocumentTermMatrix to wfm. tm_corpus2wfm - Convert a Corpus package corpus to a wfm. tm_corpus2df - Convert a tm package corpus to a dataframe. tdm - Create term document matrices from raw text or wfm for use with other text analysis packages. dtm - Create document term matrices from raw text or wfm for use with other text analysis packages. polarity_frame - Generate a polarity lookup hash key for use with the polarity.frame argument in the polarity function.

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
tm.corpus
A Corpus object.
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).
...
Other arguments passed to sentSplit.

Warning

polarity_frame - function is deprecated. It will be removed in a subsequent version of qdap. Use sentiment_frame instead.