coltheart.N: Compute Coltheart's N

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

View source: R/coltheart.N.R

Description

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

Usage

1
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

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

Example output

Loading required package: stringdist
sh: 1: wc: Permission denied
sh: 1: cannot create /dev/null: Permission denied
Could not detect number of cores, defaulting to 1.
Loading required package: lattice
Loading required package: latticeExtra
Loading required package: RColorBrewer
         galindo      pensionista apost<U+00F3>lico        carbonero 
               0                0                1                1 
          versta  can<U+00F3>nico        impresora     protocolario 
               0                2                0                1 
       emocional          acierto           single       guardapelo 
               1                1                0                0 
tard<U+00ED>amente          mazorca         arrobado        sostenida 
               0                1                3                1 
        moralina           majada fant<U+00E1>stica          anclaje 
               0                7                1                0 
         galindo      pensionista apost<U+00F3>lico        carbonero 
               0                0                1                1 
          versta  can<U+00F3>nico        impresora     protocolario 
               0                2                1                1 
       emocional          acierto           single       guardapelo 
               1                2                1                0 
tard<U+00ED>amente          mazorca         arrobado        sostenida 
               0                1                3                1 
        moralina           majada fant<U+00E1>stica          anclaje 
               0                8                1                0 

vwr documentation built on May 2, 2019, 4:23 a.m.