Get or set the document names of a corpus, tokens, or dfm object.
docnames(x) docnames(x) <- value
x | the object with docnames |
---|---|
value | a character vector of the same length as |
docnames
returns a character vector of the document names
docnames <-
assigns new values to the document names of an object.
# query the document names of a corpus docnames(data_corpus_irishbudget2010)#> [1] "2010_BUDGET_01_Brian_Lenihan_FF" #> [2] "2010_BUDGET_02_Richard_Bruton_FG" #> [3] "2010_BUDGET_03_Joan_Burton_LAB" #> [4] "2010_BUDGET_04_Arthur_Morgan_SF" #> [5] "2010_BUDGET_05_Brian_Cowen_FF" #> [6] "2010_BUDGET_06_Enda_Kenny_FG" #> [7] "2010_BUDGET_07_Kieran_ODonnell_FG" #> [8] "2010_BUDGET_08_Eamon_Gilmore_LAB" #> [9] "2010_BUDGET_09_Michael_Higgins_LAB" #> [10] "2010_BUDGET_10_Ruairi_Quinn_LAB" #> [11] "2010_BUDGET_11_John_Gormley_Green" #> [12] "2010_BUDGET_12_Eamon_Ryan_Green" #> [13] "2010_BUDGET_13_Ciaran_Cuffe_Green" #> [14] "2010_BUDGET_14_Caoimhghin_OCaolain_SF"#> [1] "BNP" "Coalition" "Conservative" "Greens" "Labour" #> [6] "LibDem" "PC" "SNP" "UKIP"#> [1] "1789-Washington" "1793-Washington" "1797-Adams" "1801-Jefferson" #> [5] "1805-Jefferson"# reassign the document names of the inaugural speech corpus docnames(data_corpus_inaugural) <- paste("Speech", 1:ndoc(data_corpus_inaugural), sep="")