nchars | R Documentation |
Count the number of characters
nchars(x, ...) ## S4 method for signature 'partition' nchars( x, p_attribute = "word", regexCharsToKeep = "[a-zA-Z]", toLower = TRUE, decreasing = TRUE ) ## S4 method for signature 'subcorpus' nchars( x, p_attribute = "word", regexCharsToKeep = "[a-zA-Z]", toLower = TRUE, decreasing = TRUE ) ## S4 method for signature 'partition_bundle' nchars(x, mc = FALSE, progress = TRUE, decreasing = TRUE, ...) ## S4 method for signature 'subcorpus_bundle' nchars(x, decreasing = TRUE, mc = FALSE, progress = TRUE, ...) ## S4 method for signature 'corpus' nchars( x, p_attribute = "word", toLower = TRUE, sample = 5000000L, regexCharsToKeep = "[a-zA-Z]", decreasing = TRUE, mc = FALSE, progress = TRUE )
x |
Object to process. |
... |
Argument passed into |
p_attribute |
the p-attribute |
regexCharsToKeep |
if NULL, counts for all charactrs will be returned, else a regex indicating which characters to include in the counting |
toLower |
whether to lower tokens |
decreasing |
logical, passed into order call |
mc |
logical |
progress |
A |
sample |
An |
library(polmineR) use("RcppCWB") partition("REUTERS", id = "127") %>% nchars() corpus("REUTERS") %>% subset(id == "127") %>% nchars() corpus("REUTERS") %>% partition_bundle(s_attribute = "id") %>% nchars() corpus("REUTERS") %>% split(s_attribute = "id") %>% nchars() library(polmineR) use("RcppCWB") n <- corpus("REUTERS") %>% nchars(sample = 4000)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.