Generates appropriately formatted captions for plots, handling special cases
for dementia-related variants. For dementia variants, removes "dementia" from
the adjustment factors list since it's not relevant for these subgroups.
Usage
create_caption(variant, width = 60)
Arguments
- variant
String, variant name (e.g., "overall", "dementia", "no dementia")
- width
Numeric, number of characters to wrap the caption at (default: 60)
Value
String containing the formatted and wrapped caption
Examples
if (FALSE) { # \dontrun{
# Standard caption
create_caption("overall")
# Caption for dementia subgroup (removes dementia from adjustments)
create_caption("dementia")
# Caption with custom width
create_caption("overall", width = 40)
} # }