set_dfm_dimnames<- | R Documentation |
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.
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 |
dfmat <- dfm(tokens(c("a a b b c", "b b b c")))
quanteda:::set_dfm_featnames(dfmat) <- paste0("feature", 1:3)
quanteda:::set_dfm_docnames(dfmat) <- paste0("DOC", 1:2)
quanteda:::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.