Learn R Programming

sdtmchecks (version 1.0.0)

check_rs_rscat_rsscat: Check for patients with populated RSSCAT but missing RSCAT.

Description

Check for patients with populated RSSCAT but missing RSCAT in RS domain to help flag a potential mapping issue for SPA; this does not warrant a query in Rave.

Usage

check_rs_rscat_rsscat(RS)

Value

boolean value if check failed or passed with 'msg' attribute if the test failed

Arguments

RS

Response SDTM dataset with variables USUBJID, RSCAT and RSSCAT.

Author

Saibah Chohan, Ashley Mao, Tina Cho (HackR 2021 Team STA-R)

Examples

Run this code

RS <- data.frame(
 USUBJID = c("id1", "id1", "id2", "id2", "id3"),
 RSCAT = c("A", "A", "B", NA, NA),
 RSSCAT = c("AA", "AA", "BB", "BB","AA"))
check_rs_rscat_rsscat(RS)

# Test with missing RSCAT
RS$RSCAT = NULL
check_rs_rscat_rsscat(RS)

Run the code above in your browser using DataLab