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

Description Usage Arguments Value Examples

View source: R/dfm-print.R

Description

For a dfm object, returns the first or last n documents and first nfeat features.

Usage

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

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

Arguments

x

a dfm object

n

a single, positive integer. If positive, size 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.

nf

the number of features to return, where the resulting object will contain the first ncol features; default is all features

...

additional arguments passed to other functions

Value

A dfm class object corresponding to the subset defined by n and nfeat.

Examples

1
2
3
4
5

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