Learn R Programming

quanteda.textstats (version 0.97.2)

nscrabble: 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)

Value

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

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. Missing values are automatically removed.

Author

Kenneth Benoit

Examples

Run this code
nscrabble(c("muzjiks", "excellency"))
nscrabble(quanteda::data_corpus_inaugural[1:5], mean)

Run the code above in your browser using DataLab