stringProbs: Function to determine the probability of a particular...

Description Usage Arguments Details Value Author(s) References Examples

View source: R/stringProbs.R

Description

Given a large database of character strings to be compared, this function takes a random sample, without replacement, from the first character string, and compares it to all other string.2 characters.

Usage

1
stringProbs(dat, N = 10)

Arguments

dat

A data frame with two columns. Column 1 contains the first string and column 2 contains the second.

N

The number of string.1 character strings to sample.

Details

The argument N can be equal to the total number of rows in the dataframe, but it cannot be larger.

Value

A dataframe with the cumulative probability of each normalized edit distance data

Author(s)

Harold C. Doran

References

See Levenshtein documention distributed with this package

Examples

1
2
3
4
5
dat <- data.frame(fname1 = c('Joseph McCall', 'Paul Jones', 'Larry Everett', 'Sam Thompson', 'Sally Fields', 'Doug Carter', 'Bill Friendly', 'Tom Davison', 'Frank Mann', 'Mary Jones'),
fname2 = c('Joe McCall', 'Paul Jones', 'Barry Everett', 'Samuel Thompson', 'Sally Fields', 'Douglas Carter', 'William Friend', 'Tommy Davison', 'Franklin Mann', 'Cary Jones'))

## Randomly sample five names from the data.
stringProbs(dat, N=5)

wasabi1989/MiscPsycho documentation built on Jan. 19, 2020, 12:29 a.m.