matchLinkServer | R Documentation |
Given two datasets, a "reference" and an "external" or "comparison" dataset, both presumably containing at least some of the same variables, this module implements a drag-and-drop interface that allows users to interactively harmonize variables (pair them) as parameters for matching.
matchLinkServer(
id,
refdata,
inputdata,
vars,
guess = NULL,
informd = system.file("info/matching_methods.Rmd", package = "DIVE")
)
id |
Character ID for specifying namespace, see |
refdata |
Reactive reference |
inputdata |
Reactive |
vars |
A named list of a variable set (or sets) in the data that is allowed for matching. See details. |
guess |
Optional, name of the function to call for initial guessing of harmonized variables. See details. |
informd |
Optional, relative path to an info Rmarkdown file that will be pulled up in a help modal. Recommend using for providing methods details of the matching algorithm. |
The drops are initialized with the specified vars
in refdata
,
and then a "variable bank" is initialized when given inputdata
.
vars
should be provided as a list such as list(Variables = c("age", "sex", "BMI", "biomarkerLevel"))
or
list(Demographic = c("age", "sex"), Clinical = c("BMI", "biomarkerLevel"))
.
A guess function can be provided to attempt guessing which variables are actually the same between the datasets,
which will run and pre-populate the pairs before the user does manual linkage of variables
The guess function should be specific to the dataset and the domain.
For example, if we can expect demographic-type datasets, the function can look for "sex" or "gender"
in the incoming dataset to be matched with "sex" in the reference data,
so that the user doesn't have to specify this manually.
Its return should contain a list with all matchable variables in refdata
and
the match in inputdata
, or NULL
if no match.
The returned reactive list is intended to be used as inputs to matchResultServer
:
params$matchOpts
contains all the possible variables that could be used between the two datasets
params$matchOn
contains variables that were actually paired up for matching
params$run
transmits the "finalized" params/triggers matchResultServer
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.