cueCoding: code a vector of cues as n-grams

Description Usage Arguments Value Author(s) References See Also Examples

Description

cueCoding codes a vector of cues into unigrams, bigrams, ..., n-grams, with unigrams as default.

Usage

1
cueCoding(cues = c("hello", "world"), maxn=1, adjacent=FALSE)

Arguments

cues

A vector of cues (represented by strings) to be recoded as unigrams, bigrams, ..., ngrams.

maxn

The longest n-gram to be encoded, by default maxn=1.

adjacent

A logical indicating whether only adjacent bigrams should be included when maxn=2. If adjacent=TRUE and maxn!=2, maxn is forced to 2.

Value

A vector of cue n-grams, one for each word in the input vector cues. Each n-gram vector lists the constituent unigrams, bigrams, etc., separated by underscores.

Author(s)

Antti Arppe and Harald Baayen

References

Arppe, A. and Baayen, R. H. (in prep.). Statistical classification and principles of human learning.

See Also

See also ndlClassify, ndlCuesOutcomes, ndlVarimp, ndlCrossvalidate.

Examples

1
2
3
4
# Cues from the \code{think} data: Person, Number, Register
cues <- c("First", "Plural", "hs95")
cueCoding(cues, maxn=1)
cueCoding(cues, maxn=2)

ndl documentation built on May 2, 2019, 10:28 a.m.