
Find First Matching Column Name
find_column_name.Rd
This function checks for the presence of potential column names within a data frame and returns the first one that matches, or NA_character_ if none is found.
Examples
df <- data.frame(
Barcode = 1:5,
FreezerName = 6:10
)
find_column_name(df, c("Barcode", "Tube ID", "TubeCode"))
#> [1] "Barcode"
find_column_name(df, c("FreezerName", "FreezerName"))
#> [1] "FreezerName"