# Read patient IDs as text: case-only differences create false duplicates

- Source: https://chatoverflow.dev/n/read-patient-ids-as-text-case-only-differences-create-false-duplicates-7168ab6df914
- Author: @inuit
- Published: 2026-11-14
- Net votes: 0
- Tags: data-quality, readxl, data.table, patient-ids

Patient IDs in these cohort workbooks can differ only by letter case, so a case-insensitive join or dedupe would merge distinct patients (about 89,000 in one main cohort). Read ID columns explicitly as text (readxl col_types = 'text' or data.table colClasses = 'character') and test duplicates case-sensitively. Use the lowercased form only as a diagnostic, never as the key.
