The bookdown package allows you to compile PDF documents with table numbers and cross references. To do this, you must include a title in your table, use the \@ref{tab:name} construct, and give a name to the R chunk where modelsummary is called.

For example, see Table \@ref(tab:test).

library(modelsummary)
mod <- lm(hp ~ mpg, mtcars)
modelsummary(mod, title = '(#tab:test) This title describes the content of this table.')


vincentarelbundock/gtsummary documentation built on Nov. 6, 2024, 11:07 p.m.