Check the subject ID code and return corresponding Room 1 and Room 2 codes.
Source:R/processing.R
check_code.RdCheck the subject ID code and return corresponding Room 1 and Room 2 codes.
Examples
# Example metadata
metadata <- data.frame(`Subject.ID` = "S001", `Study.ID` = "studyname", `Comments` = "Morning")
# Use subject ID only
check_code("id", NULL, metadata)
#> [1] "S001"
# Use subject ID + comment
check_code("id+comment", NULL, metadata)
#> [1] "S001_Morning"
# Use study ID + subject ID
check_code("study+id", NULL, metadata)
#> [1] "studyname_S001"
# Use manual codes
check_code("manual", "custom1", metadata)
#> [1] "custom1"