Helper to reshape wide-format data (one row per person-tooth, surfaces
as separate columns) into the long format expected by calc_dmft().
pivot_to_long(
data,
id = "record_id",
group = NULL,
strata = NULL,
lesion_suffix = "_les",
filling_suffix = "_fil",
activity_suffix = "_act",
code_suffix = "_code"
)A long-format tibble.
Wide data frame.
Person ID column name.
Optional grouping columns.
Optional stratification columns.
Suffixes that
identify the surface-level columns (default "_les", "_fil", "_act").
Suffix for tooth-level code columns (default "_code").
Expects columns following the naming convention:
{tooth}_{surface}_les, {tooth}_{surface}_fil, {tooth}_{surface}_act,
and {tooth}_code for tooth-level status.