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

Description Usage Arguments Value Examples

View source: R/corpus-methods-base.R

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
4
5

koheiw/quanteda.core documentation built on Sept. 21, 2020, 3:44 p.m.