Learn R Programming

soundcorrs (version 0.2.0)

findPairs: A convenience wrapper around findExamples.

Description

Sift the dataset for word pairs such that the first word contains x and the second word contains y in the corresponding segment or segments.

Usage

findPairs(data, x, y, exact, cols)

Arguments

data

[soundcorrs] The dataset in which to look. Only datasets with two languages are supported.

x

[character] The sequence to find in language1. May be a regular expression. If an empty string, anything will be considered a match.

y

[character] The sequence to find in language2. May be a regular expression. If an empty string, anything will be considered a match.

exact

[numeric] If 0 or FALSE, distance.start=distance.end=-1, na.value=0, and zeros=FALSE. If 0.5, distance.start=distance.end=1, na.value=0, and zeros=FALSE. If 1 or TRUE, distance.start=distance.end=0, na.value=-1, and zeros=TRUE. Defaults to 0.

cols

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

Value

[df.findExamples] A subset of the dataset, containing only the pairs with corresponding sequences. Warning: pairs with multiple occurrences of such sequences are only included once.

See Also

findExamples, allPairs.

Examples

Run this code
# NOT RUN {
# In the examples below, non-ASCII characters had to be escaped for technical reasons.
# In the actual usage, Unicode is supported under BSD, Linux, and macOS.
dataset <- sampleSoundCorrsData.capitals
# }

Run the code above in your browser using DataLab