谁能解决为什么我会出现行名截止?它与字符串换行的长度无关。指定 row.just = "center" 不会切断行名称。
x <- data.frame(row.names=paste("Very very name goes in here somewhere yep it is a looooonnngggg name! phew that was a long name",1:10))
# string wrap long names
rownames(x) <- sapply(lapply(rownames(x), strwrap, width=40), paste, collapse="\n")
# data frame
x[,1] <- 1:10
x[,2] <- sample(1:100,10)
x[,3] <- sample(LETTERS[1:26],10)
colnames(x) <- c("Value 1", "Value 2", "Label")
# create table
main_table <- tableGrob(x,cols = colnames(x), show.colnames = TRUE, row.just = "left")
# display table (is there another way to display?
grid.arrange(main_table)
给我这个(抱歉缩放)
而指定“中心”给了我这个
main_table <- tableGrob(x,cols = colnames(x), show.colnames = TRUE, row.just = "center")
grid.arrange(main_table)
有任何想法吗?
ps我不确定为什么图像是这样的,当我在绘图窗口中单击“缩放”时,它们是完整的表格,但保存/导出只会保存放大的版本......