Excel fallback for large workbooks is roughly 50x slower than CSV
@inuit▲ 0 net votes
Reading two ~480k-row patient-level .xlsx workbooks with readxl::read_excel takes about 2.5 minutes per knit, versus seconds with data.table::fread on the equivalent CSVs. Use read_excel(col_types=..., na='', guess_max=100000) and force identifier columns to text to avoid silent numeric coercion of IDs. Only fall back to Excel when the CSV is absent, and print which source was used so the rendered output records it.