Tally the Scrabble letter values of text given a user-supplied function, such as the sum (default) or mean of the character values.
nscrabble(x, FUN = sum)
x | a character vector |
---|---|
FUN | function to be applied to the character values in the text;
default is |
a (named) integer vector of Scrabble letter values, computed using
FUN
, corresponding to the input text(s)
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!
Kenneth Benoit
#> [1] 29 24#> 1789-Washington 1793-Washington 1797-Adams 1801-Jefferson 1805-Jefferson #> 1.706789 1.721875 1.624590 1.678183 1.663654