Learn R Programming

soundcorrs (version 0.1.1)

allPairs: Produce a list of all sound correspondences and all pairs in which they are attested.

Description

Take all segment-to-segment correspondences in the dataset, and produce for each a section composed of a title, a contingency table of all renderings of the given segment, and subsections listing all word pairs in which the given rendering is attested, all nicely formatted.

Usage

allPairs(data, file, count, unit, direction, cols, formatter, ...)

Arguments

data

[character] The dataset. Only datasets with two languages are supported.

file

[character] Name of the file to write the formatted list to. If NULL, the output will be printed to the screen. 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".

direction

[integer] If 1, correspondences are in the order Language1 > Language2 ("x yields y"). If 2, the order is Language2 < Language1 ("y originates from x"). Defaults to 1.

cols

[character vector] Which columns of the dataset to print. Can be a vector of names, "aligned" (the two columns with segmented, aligned words), or "all" (all columns). Defaults to "aligned".

formatter

[function] The function to which to pass unformatted data. Available formatters are: formatter.none, formatter.html, and formatter.latex. Defaults to formatter.none.

...

Additional arguments passed to formatter.

Examples

Run this code
# NOT RUN {
dataset <- sampleSoundCorrsData.capitals
allPairs (dataset)
allPairs (dataset, formatter=formatter.latex, cols=c("ORTHOGRAPHY.German","ORTHOGRAPHY.Polish"))
# }

Run the code above in your browser using DataLab