Learn R Programming

quanteda (version 0.9.8.5)

scrabble: compute the Scrabble letter values of text

Description

Compute the Scrabble letter values of text given a user-supplied function, such as the sum (default) or mean of the character values.

Usage

scrabble(x, FUN = sum)
"scrabble"(x, FUN = sum)

Arguments

x
a character vector
FUN
function to be applied to the character values in the text; default is sum, but could also be mean or a user-supplied function

Value

a vector of Scabble letter values, computed using FUN, corresponding to the input text(s)

Examples

Run this code
scrabble(c("muzjiks", "excellency"))
scrabble(inaugTexts[1:5], mean)

Run the code above in your browser using DataLab