Search data frame names for the first matching candidate ID column name. See details.

find_id_col(data)

Arguments

data

a data.frame to search

Details

Column names will be searched against the following candidates

  • getOption("lastdose.id_col")

  • ID

  • USUBJID

  • SUBJID

  • PTNO

  • SUBJ

The first the first candidate to be matched will be returned. If there are no matches, an error is generated.

Examples

data <- data.frame(A = 1, B = 2, PTNO = 3, ID = 4, Z = 99)
lastdose:::find_id_col(data)
#> [1] "ID"