docnames

0th

Percentile

get or set document names

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

Keywords
corpus, dfm
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

Aliases
  • docnames
  • docnames<-
Examples
# NOT RUN {
# get and set doument names to a corpus
mycorp <- data_corpus_inaugural
docnames(mycorp) <- char_tolower(docnames(mycorp))

# get and set doument names to a tokens
mytoks <- tokens(data_corpus_inaugural)
docnames(mytoks) <- char_tolower(docnames(mytoks))

# get and set doument names to a dfm
mydfm <- dfm(data_corpus_inaugural[1:5])
docnames(mydfm) <- char_tolower(docnames(mydfm))

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

# }
Documentation reproduced from package quanteda, version 0.99.22, License: GPL-3

Community examples

Looks like there are no examples yet.