请考虑以下示例:
id <- rep(seq(1,10), each=5)
year <- rep(seq(2021, 2025), times=10)
df <- data.frame(id=id, year=year)
df[["weight"]] <- rnorm(nrow(df), 100, 10)
df[["height"]] <- 2*df$weight+rnorm(nrow(df), 0, 5)
df[["count"]] <- rpois(nrow(df), df$height+rnorm(nrow(df), 0, 5))
mod <- fixest::fepois(count ~ height | id, df)
modelsummary::modelsummary(mod, title="This is my title")
我想要表格顶部的标题:
背景信息:
modelsummary
使用该tinytable
包绘制表格。tinytable
使用Bootstrap 5来设置表格样式。style_tt()
您可以使用包中的函数应用表格类tinytable
来更改标题的位置。这是此处的文档: https: //vincentarelbundock.github.io/tinytable/vignettes/custom.html#bootstrap-classes实际上,它看起来像这样:
为了方便起见,您可以定义自定义主题以将此更改自动应用于所有表。请参阅此处的文档:
https://vincentarelbundock.github.io/tinytable/vignettes/theme.html#custom-themes