Functions to build or re-build core objects, or to upgrade earlier versions of these objects to the current format.
build_dfm(
x,
features,
docvars = data.frame(),
meta = list(),
class = "dfm",
...
)rebuild_dfm(x, attrs)
upgrade_dfm(x)
build_tokens(
x,
types,
padding = FALSE,
docvars = data.frame(),
meta = list(),
class = "tokens",
...
)
rebuild_tokens(x, attrs)
upgrade_tokens(x)
build_corpus(x, docvars = data.frame(), meta = list(), class = "corpus", ...)
rebuild_corpus(x, attrs)
upgrade_corpus(x)
build_dictionary2(x, meta = list(), ...)
rebuild_dictionary2(x, attrs)
upgrade_dictionary2(x)
an input corpus, dfm, tokens, or dictionary object
character for feature of resulting dfm
data.frame for document level variables
list for meta fields
class to be attached to the built object
further objects passed to object metadata
a list of attributes to be reassigned
character for types of resulting `tokens`` object
logical indicating if the tokens
object contains paddings