head.corpus: Return the first or last part of a corpus

Description Usage Arguments Value Examples

Description

For a corpus object, returns the first or last n documents.

Usage

1
2
3
4
5
## S3 method for class 'corpus'
head(x, n = 6L, ...)

## S3 method for class 'corpus'
tail(x, n = 6L, ...)

Arguments

x

a dfm object

n

a single integer. If positive, the number of documents for the resulting object: number of first/last documents for the dfm. If negative, all but the n last/first number of documents of x.

...

additional arguments passed to other functions

Value

A corpus class object corresponding to the subset defined by n.

Examples

1
2
3

quanteda/quanteda documentation built on June 15, 2019, 8:36 a.m.