nscrabble {quanteda.textstats} | R Documentation |
Count the Scrabble letter values of text
Description
Tally the Scrabble letter values of text given a user-supplied function, such as the sum (default) or mean of the character values.
Usage
nscrabble(x, FUN = sum)
Arguments
x |
a character vector |
FUN |
function to be applied to the character values in the text;
default is |
Value
a (named) integer vector of Scrabble letter values, computed using
FUN
, corresponding to the input text(s)
Note
Character values are only defined for non-accented Latin a-z, A-Z letters. Lower-casing is unnecessary.
We would be happy to add more languages to this extremely useful function if you send us the values for your language!
Author(s)
Kenneth Benoit
Examples
nscrabble(c("muzjiks", "excellency"))
nscrabble(quanteda::data_corpus_inaugural[1:5], mean)
[Package quanteda.textstats version 0.97.2 Index]