Rmarkdown 文件中的 R 代码:
col1 <- c("dummydata","dummydata","dummydata")
col2 <- c("dummydata","dummydata","dummydata")
col3 <- c("dummydata","dummydata","dummydata")
col4 <- c("dummydata","dummydata","dummydata")
col5 <- c("dummydata","dummydata","dummydata")
col6 <- c("dummydata","dummydata","dummydata")
col7 <- c("dummydata","dummydata","dummydata")
col8 <- c("dummydata","dummydata","dummydata")
df1 <- data.frame(col1,col2,col3,col4,col5,col6,col7,col8)
kable(df1, format="html",table.attr='class="myTable"') %>%
kable_styling(bootstrap_options = c("striped", "hover", "condensed", "responsive")) %>%
add_header_above(c("Group1" = 2, "Group2" = 2,"Group3" = 2, "Group4" = 2))
问题:我只想要组合列上的标题,即 Group1、Group2 等。我想删除单个列上的标题,即 col1、col2 等。
有没有办法使用数据框、html/javascript、Rmarkdown 或任何 R 包来做到这一点?