head.dfm {quanteda} | R Documentation |
Return the first or last part of a dfm
Description
For a dfm object, return the dfm with only the first or last n
documents.
Usage
## S3 method for class 'dfm'
head(x, n = 6L, ...)
## S3 method for class 'dfm'
tail(x, n = 6L, ...)
Arguments
x |
a dfm object |
n |
an integer vector of length up to |
... |
arguments to be passed to or from other methods. |
Value
A dfm class object corresponding to the subset of documents
determined by by n
.
Examples
head(data_dfm_lbgexample, 3)
head(data_dfm_lbgexample, -4)
tail(data_dfm_lbgexample)
tail(data_dfm_lbgexample, n = 3)