Function to extract the unique values for subject identifiers in a data frame, assuming a common variable name (e.g., IDS.CHR.Subject or ID).

pull_id(dtf, subject = TRUE, id = NULL)

Arguments

dtf

A data frame.

subject

Logical; if TRUE looks for common variable names for subject identifiers (IDS.CHR.Subject, ID, etc.). If FALSE looks for common variable names for screening identifiers (IDS.CHR.Screen, etc.).

id

A user-defined variable name if the column with subject identifiers is not part of the commonly-used labels.

Value

A vector of values.

Examples

dtf <- data.frame( ID = rep( 1:3, each = 3 ), X = rnorm(9) )
pull_id( dtf )
#> [1] 1 2 3