Description Usage Arguments Value Examples
Select documents from a TermDocumentMatrix
or DocumentTermMatrix
matching a regular expression.
1 | select_documents(x, pattern, invert = FALSE, ...)
|
x |
A |
pattern |
A regex pattern used to select documents. |
invert |
logical. If |
... |
Other arguments passed to |
Returns a TermDocumentMatrix
or DocumentTermMatrix
.
1 2 3 4 5 6 | (x <-with(presidential_debates_2012, q_dtm(dialogue, paste(time, person, sep = "_"))))
select_documents(x, 'romney', ignore.case=TRUE)
select_documents(x, '^(?!.*romney).*$', ignore.case = TRUE) # regex way to invert
select_documents(x, 'romney', ignore.case = TRUE, invert = TRUE) # easier way to invert
(y <- with(presidential_debates_2012, q_tdm(dialogue, paste(time, person, sep = "_"))))
select_documents(y, '[2-3]')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.