numIncrease: numIncrease

Description Usage Arguments Value Examples

Description

Checks for two possible matches the intervals $\[t_i,j-max_j, t_i,j-min_j\]$ intersect. If the condition fails than each Levenshtein distance will be increased by one.

Usage

1
2

Arguments

match

match structure

data

list of data frames

min

minimal in/decrease, defaults to rep(0, length(data))

max

maximal in/decrease, defaults to 0:(length(data)-1)

...

named list of variables (one for each data frame)

Value

updated match structure

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
set.seed(0)
# create two data sets where the second consists of
# 200 obs. only in t1, 200 obs. in t1 and t2 and
# 100 obs. only in t2
n <- list(c(200, 1), c(200, 1, 2), c(100, 2))
x <- generateTestData(n)
# create ages in years from birthdays
today  <- as.Date(Sys.time())
x[[1]]$age <- as.numeric(trunc(difftime(today, x[[1]]$birthday, unit="days")/365))
x[[2]]$age <- as.numeric(trunc(difftime(today+365, x[[2]]$birthday, unit="days")/365))
#
match <- findMatch(x, c('code', 'code'))
summary(match)
match <- numIncrease(match, x, age=c('age', 'age'))
summary(match)
head(match)
## Not run: 
# with %>% operator
library('magrittr')
match <- findMatch(x, c('code', 'code')) %>%
         numIncrease(x, age=c('age', 'age'))

## End(Not run)

sigbertklinke/findMatch documentation built on July 12, 2019, 9:22 a.m.