as.dfm: Coercion and checking functions for dfm objects

Description Usage Arguments Value See Also

View source: R/dfm-methods.R

Description

Convert an eligible input object into a dfm, or check whether an object is a dfm. Current eligible inputs for coercion to a dfm are: matrix, (sparse) Matrix, TermDocumentMatrix and DocumentTermMatrix (from the tm package), data.frame, and other dfm objects.

Usage

1
2
3
as.dfm(x)

is.dfm(x)

Arguments

x

a candidate object for checking or coercion to dfm

Value

as.dfm converts an input object into a dfm. Row names are used for docnames, and column names for featnames, of the resulting dfm.

is.dfm returns TRUE if and only if its argument is a dfm.

See Also

as.data.frame.dfm(), as.matrix.dfm(), convert()


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