英文:
Setting row height in huxtable
问题
I'm using the expss
package to generate tables and then passing them to huxtable
. This works fine but height
function does not seem to work. Any insights? This occurs regardless of using a theme or exporting to HTML or Word.
t <- mpg %>%
tab_cells(hwy, displ) %>%
tab_rows(manufacturer) %>%
tab_stat_mean() %>%
tab_pivot() %>%
set_caption("Car Stats") %>%
as_huxtable() %>%
set_col_width(1, .1) %>%
theme_article()
height(t) <- 0.1 # if I change this to 0.2 I get the same result...
t
英文:
I'm using the expss
package to generate tables and then passing them to huxtable
This works fine but height
function does not seem to work. Any insights? This occurs regardless of using a theme or exporting to HTML or Word.
t<-mpg %>% tab_cells(hwy,displ) %>%
tab_rows(manufacturer) %>%
tab_stat_mean() %>%
tab_pivot() %>%
set_caption("Car Stats") %>%
as_huxtable() %>%
set_col_width(1,.1) %>%
theme_article()
height(t)<-0.1 # if I change this to 0.2 I get the same result...
t
答案1
得分: 1
行高的最小值是1.0。要将行放置得更近,可以使用以下示例中的padding
:
mpg %>% tab_cells(hwy,displ) %>%
tab_rows(manufacturer) %>%
tab_stat_mean() %>%
tab_pivot() %>%
set_caption("Car Stats") %>%
as_huxtable() %>%
set_top_padding(.2) %>%
set_bottom_padding(.2) %>%
theme_article()
英文:
The row height minimum is 1.0. To place rows closer together, use padding
as shown below:
mpg %>% tab_cells(hwy,displ) %>%
tab_rows(manufacturer) %>%
tab_stat_mean() %>%
tab_pivot() %>%
set_caption("Car Stats") %>%
as_huxtable() %>%
set_top_padding(.2) %>%
set_bottom_padding(.2) %>%
theme_article()
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论