Last data update: 2014.03.03

R: Compute Coltheart's N
coltheart.NR Documentation

Compute Coltheart's N

Description

Compute Coltheart's N measure (the number of neighbors at distance 1).

Usage

coltheart.N(sources, targets, distance = 1, method = "hamming", parallel = FALSE)

Arguments

sources

a list of words for which Coltheart's N should be computed. Must be of type character, or convertible to type character with as.character.

targets

a list of words containing possible neighbors. Must be of type character, or convertible to type character with as.character.

parallel

with parallel=TRUE, coltheart.N will run in parallel an multiple cores. The number of parallel processes is specified by detectCores(logical = FALSE).

distance

specifies the distance on which N should be based. This should be left to 1 to compute the original measure.

method

with method="hamming", compute N based on the hamming.distance, with method="levenshtein", compute N based on the levenshtein.distance with method="levenshtein-damerau", compute N based on the levenshtein.damerau.distance

Value

An integer vector with names corresponding to sources.

Author(s)

Emmanuel Keuleers

References

Coltheart, M., Davelaar, E., Jonasson, J. T., & Besner, D. (1977). Access to the internal lexicon. Attention and performance VI, 535–555.

See Also

hamming.distance,levenshtein.distance

Examples

data(spanish.words)
sample.words<-sample(spanish.words,20)
coltheart.N(sample.words,spanish.words)
coltheart.N(sample.words,spanish.words, method='levenshtein')

Results