Learn R Programming

quanteda (version 0.99)

docnames: get or set document names

Description

Get or set the document names of a corpus, tokens, or dfm object.

Usage

docnames(x)

docnames(x) <- value

Arguments

x

the object with docnames

value

a character vector of the same length as x

Value

docnames returns a character vector of the document names

docnames <- assigns new values to the document names of an object.

See Also

featnames

Examples

Run this code
# NOT RUN {
# query the document names of a corpus
docnames(data_corpus_irishbudget2010)

# query the document names of a tokens object
docnames(tokens(data_char_ukimmig2010))

# query the document names of a dfm
docnames(dfm(data_corpus_inaugural[1:5]))

# reassign the document names of the inaugural speech corpus
docnames(data_corpus_inaugural) <- paste("Speech", 1:ndoc(data_corpus_inaugural), sep="")

# }

Run the code above in your browser using DataLab