processFunctionList: Process the functions used for matching data

Description Usage Arguments Value Examples

Description

Input one or two data sets, process them with a list of containing functions, column names, and function parameters, and return a list of matrices by function.

Usage

1
processFunctionList(dat1, dat2 = NULL, funlist = list())

Arguments

dat1

An input linelist

dat2

An optional extra linelist

funlist

A list containing lists containing:

  • d1vars - variable names for dataset 1

  • d2vars - variable names for dataset 2

  • fun - function name to process on these variables

  • extraparams - extra parameters that need to be applied with the function.

  • weights - a weight vector to scale each matrix (not used in processFunctionList).

Value

a list of distance matrices scaled by weight

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
## Loading Data
indata <- system.file("files", package = "epimatch")
indata <- dir(indata, full.names = TRUE)
x <- lapply(indata, read.csv, stringsAsFactors = FALSE)
names(x) <- basename(indata)

# We will use one data set from the case information and lab results
case <- x[["CaseInformationForm.csv"]]
lab <- x[["LaboratoryResultsForm7.csv"]]

# This will get all of the indices that match the ID and Names with a
# threshold of 0.25
res <- processFunctionList(dat1 = case,
                           dat2 = lab,
                           funlist = list(
                           list(d1vars = "ID",
                                d2vars = "ID",
                                fun = "nameDists",
                                extraparams = NULL,
                                weight = 1),
                           list(d1vars = c("Surname", "OtherNames"),
                                d2vars = c("SurnameLab", "OtherNameLab"),
                                fun = "nameDists",
                                extraparams = NULL,
                                weight = 0.5)
                           ))
res # distance matrices

Hackout3/epimatch documentation built on May 6, 2019, 9:48 p.m.