编织电缆中的旋转标题栏

时间:2019-06-07 16:45:48

标签: r knitr kable

经过认真的调试后,我能够创建一个表头,表头和列头带有旋转文本的表。

enter image description here

代码如下:

library(dplyr)
library(knitr)
library(kableExtra)
library(magrittr)

in_df <- structure(list(SPÖ = c(741983, 68, 5415), 
                        ÖVP = c(15991, 1103613, 808), 
                        FPÖ = c(29786, 14046, 506087)), 
                   row.names = c(NA, -3L), 
                   class = c("tbl_df", "tbl", "data.frame"))
Parteien= c("SPÖ","ÖVP","FPÖ")
in_df %>%  
  {bind_cols(tibble(from_year=rep("2017",3)),.)} %>%
  mutate(from=Parteien) %>%
  mutate(from_year=cell_spec(from_year, "latex", angle=90, bold=T)) %>% 
  select(from_year,from,everything()) %>%
  kable("latex",digits=-3,col.names = c("  "," " ,Parteien),escape=F)  %>%
  row_spec(0,bold=T) %>%
  add_header_above(c(" "=2,"2019"=3),bold=T)  %>% 
  column_spec(2, bold = T)  %>%
 collapse_rows(columns = 1, valign = "middle")

最后一个烦恼:

enter image description here

我想删除左上方单元格内部的细小的分隔线。
可以使用kableExtra

完成吗

0 个答案:

没有答案