quanteda (version 2.1.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)

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 (named) integer vector of Scrabble letter values, computed using FUN, corresponding to the input text(s)

Examples

Run this code
# NOT RUN {
nscrabble(c("muzjiks", "excellency"))
nscrabble(texts(data_corpus_inaugural)[1:5], mean)
# }

Run the code above in your browser using DataCamp Workspace