Skip to contents

Searches a vector of candidate column names and returns the first one that exists in df. Used throughout the package to tolerate the assorted column naming conventions of tumour-documentation spreadsheets.

Usage

.find_col(df, candidates)

Arguments

df

A data frame.

candidates

Character vector of candidate column names, in priority order.

Value

Length-1 character scalar with the matched column name, or NULL if no candidate matched. Never returns character(0).