map_headers: robust matching of a list of desired columns to a character...

View source: R/util_files.R

map_headersR Documentation

robust matching of a list of desired columns to a character array representing column headers

Description

instead of literal string matching between 'headers' and values in l, strip/cleanup both by removing all non-alphanumeric characters and convert to lowercase.

Usage

map_headers(headers, l, error_on_missing = FALSE, allow_multiple = FALSE)

Arguments

headers

character array representing column names

l

list of mappings, where list names are target column names and values are character arrays that are (ordered) valid values to represent a column

error_on_missing

throw error if any element in l fails to match

allow_multiple

throw error if any element in l has multiple matches


ftwkoopmans/msdap documentation built on March 5, 2025, 12:15 a.m.