Learn R Programming

soundcorrs (version 0.4.0)

merge.soundcorrs: Merge two or more soundcorrs objects.

Description

Take multiple soundcorrs objects and combine them into one.

Usage

# S3 method for soundcorrs
merge(...)

Arguments

...

[soundcorrs] Objects to be merged.

Value

[soundcorrs] The single, merged object.

Details

Data can be turned into a soundcorrs object using either read.soundcorrs or, the less preferred method, the raw soundcorrs constructor. However, both can only produce soundcorrs objects with only the data for a single language in them, whereas the typical usage of the soundcorrs package would require it to hold data for several languages simultaneously. This function can be used to safely combine multiple soundcorrs objects into one. The individual objects can all hold data for one or more languages, the only requirement being that the data from the different languages are compatible with each other, i.e. that they have the same number of words, and each word has the same number of segments as its counterparts in the pair/triple/.... An error will be also thrown if two or more of the datasets contain a column with the same name and different content, or when they contain two or more rows with identical content.

Examples

Run this code
# NOT RUN {
# path to sample data in the "wide format"
fNameData <- system.file ("extdata", "data-capitals.tsv", package="soundcorrs")
# path to a sample transcription
fNameTrans <- system.file ("extdata", "trans-common.tsv", package="soundcorrs")
ger <- read.soundcorrs (fNameData, "German", "ALIGNED.German", fNameTrans)
pol <- read.soundcorrs (fNameData, "Polish", "ALIGNED.Polish", fNameTrans)
merge (ger, pol)
# }

Run the code above in your browser using DataLab