Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/76.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R 向表中添加标题_R_Gt - Fatal编程技术网

R 向表中添加标题

R 向表中添加标题,r,gt,R,Gt,我想在桌子的顶部/底部添加标题。gt包中是否有标题功能 gt(head(mtcars)) %>% tab_header(title="", subtitle="Table 1: Mtcars with gt.") %>% tab_options(table.width=pct(90), table.border.top.style=0,

我想在桌子的顶部/底部添加标题。
gt
包中是否有
标题
功能

 gt(head(mtcars)) %>%
        tab_header(title="", subtitle="Table 1: Mtcars with gt.") %>%
        tab_options(table.width=pct(90),
                        table.border.top.style=0,
                        row.padding=px(4)) %>%
            tab_style(style=cells_styles(
                          text_align='left',
                          text_color='grey'),
                  locations=cells_title(groups="subtitle"))

通过从Github安装包的开发版本,我可以获得
caption
参数

#devtools::install_github("rstudio/gt")
library(gt)

gt(head(mtcars), caption = 'This is table caption') %>%
  tab_header(title="A", subtitle="Table 1: Mtcars with gt.")

标题是否可以左对齐而不是居中?我找不到
标题的对齐选项。