我目前正在使用以下方法创建表格图像:
SummaryTable <- data.frame(
index,
xa,
xb,
ya,
yb,
za,
zb
)
names(SummaryTable) <- c("Index",
"Main X Sub A",
"Main X Sub B",
"Main Y Sub A",
"Main Y Sub B",
"Main Z Sub A",
"Main Z Sub B")
tt <- ttheme_default(colhead=list(fg_params = list(parse=TRUE)))
tbl <- tableGrob(SummaryTable, rows=NULL, theme=tt)
grid.arrange(tbl,as.table=TRUE)
Run Code Online (Sandbox Code Playgroud)
使用dput(SummaryTable):
structure(list(Index = 0:8, `Main X Sub A` = c(1, 0.69, 0.61,
0.56, 0.5, 0.44, 0.4, 0.36, 0.33), `Main X Sub B` = c(0.86, 0.62,
0.51, 0.42, 0.36, 0.31, …Run Code Online (Sandbox Code Playgroud)