Learn R Programming

gtx (version 0.0.8)

multimatch: Match with multiple matching possible.

Description

Function to represent results of matching when each query argument may match multiple elements in the target.

Usage

multimatch(query, target, values, sep = ",", use.unique = TRUE)

Arguments

query
Vector of values to be matched.
target
Vector of values that query is to be matched against.
values
Vector of values to be returned for matches in target.
sep
Character to separate values for multiple matches.
use.unique
Logical flag indicating whether to return unique set of values only.

Value

A character vector of length length(query).

Examples

Run this code
bmidata <- data.frame(subject = c("A001", "A002", "A003", "A003"),
                      year = c(2001, 2001, 2001, 2005),
                      bmi = c(21.3, 29.7, 25.5, 22.3))
multimatch(c("A002", "A003"), bmidata$subject, bmidata$bmi)

Run the code above in your browser using DataLab