Learn R Programming

soundcorrs (version 0.2.0)

coocc: Generate a contingency table of co-occurrences of sound correspondences with themselves, or with metadata.

Description

Take all segment-to-segment correspondences in a dataset, and cross-tabulate them with themselves or with metadata taken from a separate column.

Usage

coocc(data, column, count, unit)

Arguments

data

[soundcorrs] The dataset from which to draw frequencies. Only datasets with two languages are supported.

column

[character] Name of the column with metadata. If NULL, sound correspondences are cross-tabulated with themselves. Defaults to NULL.

count

[character] Report the absolute number of times or words, or relative to how many times or in how many words the given segments co-occur in L1 or L2. Accepted values are "a(bs(olute))" and "r(el(ative))". Defaults to "a".

unit

[character] Count how many times a correspondence occurs or in how many words it occurs. Accepted values are "o(cc(ur(ence(s))))" and "w(or(d(s)))". Defaults to "w".

Value

[table] The contingency table. The values represent how often the given correspondence co-occurs in the same word with the other correspondence or with the piece of metadata (cf. summary).

See Also

summary, allCooccs.

Examples

Run this code
# NOT RUN {
dataset <- sampleSoundCorrsData.abc
coocc (dataset)
coocc (dataset, "DIALECT.L2")
round (coocc(dataset,"DIALECT.L2",count="r"), digits=3)
# }

Run the code above in your browser using DataLab