Description Usage Arguments Value See Also Examples
A dictionary lookup that maps words to colors.
1 | text2color(words, recode.words, colors)
|
words |
A vector of words. |
recode.words |
A vector of unique words or a list of unique word vectors that will be matched against corresponding colors. |
colors |
A vector of colors of equal in length to recode.words + 1(the +1 is for unmatched words). |
Returns a vector of mapped colors equal in length to the words vector.
1 2 3 4 5 6 7 8 9 | set.seed(10)
x <- data.frame(X1 = sample(Top25Words[1:10], 20, TRUE))
#blue was recycled
text2color(x$X1, qcv(the, and, is), qcv(red, green, blue))
text2color(x$X1, qcv(the, and, is), qcv(red, green, blue, white))
x$X2 <- text2color(x$X1, list(qcv(the, and, is), "that"),
qcv(red, green, white))
x
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.