Skip to contents

Helper function to create a properly formatted table caption for appendices. This is useful when using flextable::set_caption() to ensure consistent formatting with automatic numbering.

Usage

appendix_table_caption(caption, appendix_letter = NULL)

Arguments

caption

Character. The table caption text

appendix_letter

Character. The appendix letter (e.g., "A", "B"). If NULL, uses the value set by set_appendix() or new_appendix()

Value

Character. A formatted caption string

Examples

library(flextable)
new_appendix()
#> [1] "A"
df <- data.frame(a = 1:3)
flextable(df) |>
  set_caption(appendix_table_caption("Summary statistics"))
Summary statistics

a

1

2

3

# Or with set_appendix() set_appendix("A") flextable(df) |> set_caption(appendix_table_caption("Model parameters"))
Model parameters

a

1

2

3