tif_is_corpus_character | R Documentation |
A valid character vector corpus object is an character vector with UTF-8 encoding. If it has names, this should be a unique character also in UTF-8 encoding. No other attributes should be present.
tif_is_corpus_character(corpus, warn = FALSE)
corpus |
a corpus object to test for validity |
warn |
logical. Should the function produce a verbose warning for the condition for which the validation fails. Useful for testing. |
The tests are run sequentially and the function returns, with a warning if the warn flag is set, on the first test that fails. We use this implementation because some tests may fail entirely or be meaningless if the prior ones are note passed.
a logical vector of length one indicating whether the input is a valid corpus
corpus <- c("Aujourd'hui, maman est morte.",
"It was a pleasure to burn.",
"All this happened, more or less.")
tif_is_corpus_character(corpus)
names(corpus) <- c("Camus", "Bradbury", "Vonnegut")
tif_is_corpus_character(corpus)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.