Description Usage Arguments Examples
Default dimnames()
converts a zero-length character vector to NULL,
leading to the improper functioning of subsetting functions. These are safer
methods to set the dimnames of a dfm or fcm object.
1 2 3 4 5 6 7 8 9 | set_dfm_dimnames(x) <- value
set_dfm_docnames(x) <- value
set_dfm_featnames(x) <- value
set_fcm_dimnames(x) <- value
set_fcm_featnames(x) <- value
|
x |
dfm or fcm |
value |
character a vector for docnames or featnames or a list of them for dimnames |
1 2 3 4 | dfmat <- dfm(c("a a b b c", "b b b c"))
quanteda.core:::set_dfm_featnames(dfmat) <- paste0("feature", 1:3)
quanteda.core:::set_dfm_docnames(dfmat) <- paste0("DOC", 1:2)
quanteda.core:::set_dfm_dimnames(dfmat) <- list(c("docA", "docB"), LETTERS[1:3])
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.