Learn R Programming

quanteda (version 0.9.8.5)

as.data.frame,dfm-method: coerce a dfm to a data.frame

Description

Method for coercing a dfm-class object to a data.frame

Usage

"as.data.frame"(x, row.names = NULL, optional = FALSE, ...)

Arguments

x
dfm to be coerced to a data.frame
row.names
if FALSE, do not set the row names of the data.frame to the docnames of the dfm (default); or a vector of values to which the row names will be set.
optional
not applicable to this method
...
not used for this method

Examples

Run this code
inaugDfm <- dfm(inaugTexts[1:5], verbose = FALSE)
as.data.frame(inaugDfm[, 1:10])
str(as.data.frame(inaugDfm))
as.data.frame(inaugDfm[, 1:10], row.names = FALSE)

Run the code above in your browser using DataLab