Scans a data frame for columns that might contain standard names and attempts to match them to recognized standards.
Arguments
- data
A data frame containing sample information.
- name_col
Name of the column containing sample names. If
NULL, attempts to auto-detect from common column names.- add_columns
Logical. If
TRUE, addsmatched_standardandstandard_typecolumns to the data frame. IfFALSE, returns only the matching results.
Value
If add_columns = TRUE, the original data frame with added
columns. If FALSE, a tibble with matching results.
Examples
if (FALSE) { # \dontrun{
# Auto-detect and add standard columns
data <- data.frame(
sample_name = c("PS A", "Unknown", "PMMA B"),
signal = c(100, 200, 150)
)
auto_detect_standards(data)
} # }