lookup_in_domain: Lookup a value in domain data

View source: R/lookup_domain.R

lookup_in_domainR Documentation

Lookup a value in domain data

Description

Lookup a value in domain data

Usage

lookup_in_domain(domain, value_col, key_col, key_val)

Arguments

domain

Quoted name of the domain data object

value_col

Quoted name of the column from which to pull values

key_col

Quoted name of the column to match with key_val

key_val

An expression that evaluates to values to match in key_col

Details

This function allows one to lookup values in domain data. The domain name, and the two columns to use in it are given as quoted strings. This allows the function to be used within query mappings, which would otherwise error on the domain and column names that do not match the query's mapped domain's columns. The key_val is given unquoted so the expression will be evaluated when the function is called.

One particular use is to find the treatment start date for a given ID in a query.

Value

a vector of values from value_col, of length of key_val

Examples

## Not run: 
lookup_in_domain("DM", "RFXSTDTC", "USUBJID", ID)

## End(Not run)

qPharmetra/PMDatR documentation built on April 7, 2024, 5:42 p.m.