pull.corpus | R Documentation |
Works like $
for quanteda objects with document variables, or like
docvars(x, "varname")
.
## S3 method for class 'corpus'
pull(.data, var = -1, name = NULL, ...)
## S3 method for class 'tokens'
pull(.data, var = -1, name = NULL, ...)
## S3 method for class 'dfm'
pull(.data, var = -1, name = NULL, ...)
.data |
a quanteda object with document variables |
var |
A variable specified as:
The default returns the last column (on the assumption that's the column you've created most recently). This argument is taken by expression and supports quasiquotation (you can unquote column names and column locations). |
name |
An optional parameter that specifies the column to be used
as names for a named vector. Specified in a similar manner as |
... |
For use by methods. |
tail(data_corpus_inaugural) %>% pull(President)
tail(data_corpus_inaugural) %>% pull(-1)
tail(data_corpus_inaugural) %>% pull(1)
toks <- data_corpus_inaugural %>%
tail() %>%
tokens()
pull(toks, President)
dfmat <- data_corpus_inaugural %>%
tail() %>%
tokens() %>%
dfm()
pull(dfmat, President)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.