
Flag a column whose name suggests personal information
Source:R/data_check_helpers.R
data_check_pii_name.RdMatches a column name against tokens that typically identify a person (name,
email, address, date of birth, national id, ip, coordinates, ...) in English
and the main European languages. Complements data_check_pii_values():
catches identifying columns whose values look ordinary (e.g. a
participant_name free-text field).
Details
Matching is WORD-based, not substring-based. The name is split into words on separators and camelCase, and a word must EQUAL a token. Three additions keep real names matching:
adjacent words are re-joined and tested ("first_name" -> "firstname"), because the token list holds compounds rather than the bare word "name", which would otherwise match
trial_name/file_name/condition_name;the whole separator-free name is tested, so languages that compound without separators still match ("telefoonnummer", "geboortedatum");
matching is case-insensitive throughout.
Measured against 2113 real column names and a decoy set of ordinary research vocabulary, this cut false positives from 14 to 2 while missing nothing the previous substring rule caught.