Learn R Programming

soundcorrs (version 0.4.0)

tabAbs2Rel: Convert a table from absolute to relative values.

Description

Cross-tabulating sound correspondences with themselves may be misleading if the values are absolute, as it may well be that some segments simply do co-occur frequently, while others only rarely. The conversion is done in blocks: rows with the same prefix vs cols with the same prefix (if column = NULL) or vs all columns (if column is a string).

Usage

tabAbs2Rel(tab, column)

Arguments

tab

[table] The contingency table with sound correspondences.

column

[character] Do columns contain the same data as rows (NULL) or some other data (a string)?

Value

[table] The converted table.

Details

Functions that produce contingency tables, coocc and summary, return a result in absolute numbers, but sometimes the relative perspective may be more useful. This function converts from absolute to relative, but it does so in blocks where each block is an intersection of all the columns and the all rows whose names begin with the same prefix. 'Prefix' in this case is whatever comes before an underscore ("_"), because coocc and others use underscore to connect names of columns and rows.

Examples

Run this code
# NOT RUN {
dataset <- loadSampleDataset ("data-abc")
soundcorrs:::tabAbs2Rel (coocc(dataset,unit="o"), NULL)
# }

Run the code above in your browser using DataLab