Description Usage Arguments Details Examples
View source: R/casechange-functions.R
dfm_tolower()
and dfm_toupper()
convert the features of the dfm or
fcm to lower and upper case, respectively, and then recombine the counts.
1 2 3 4 5 6 7 | dfm_tolower(x, keep_acronyms = FALSE)
dfm_toupper(x)
fcm_tolower(x, keep_acronyms = FALSE)
fcm_toupper(x)
|
x |
the input object whose character/tokens/feature elements will be case-converted |
keep_acronyms |
logical; if |
fcm_tolower()
and fcm_toupper()
convert both dimensions of
the fcm to lower and upper case, respectively, and then recombine
the counts. This works only on fcm objects created with context = "document"
.
1 2 3 4 5 6 7 8 9 10 11 12 | # for a document-feature matrix
dfmat <- dfm(c("b A A", "C C a b B"), tolower = FALSE)
dfmat
dfm_tolower(dfmat)
dfm_toupper(dfmat)
# for a feature co-occurrence matrix
fcmat <- fcm(tokens(c("b A A d", "C C a b B e")),
context = "document")
fcmat
fcm_tolower(fcmat)
fcm_toupper(fcmat)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.