我想要实现的目标
我正在尝试在ggparagraph()
中实现边距,但是我找不到任何可以帮助我的设置。我尝试在ggarrange()
中将两个宽度设置为相同,但这并没有起作用,而且这是一种变通方法。现在,当我从ggarrange()
输出中导出PDF时,文本的长度与PDF页面的宽度一样。我不想改变PDF页面的宽度。
代码
这里是一些示例代码:
text <- paste("iris data set gives the measurements in cm",
"of the variables sepal length and width",
"and petal length and width, respectively,",
"for 50 flowers from each of 3 species of iris.",
"The species are Iris setosa, versicolor, and virginica.", sep = " ")
text.p <- ggparagraph(text = text, face = "italic", size = 11, color = "black")
stable <- desc_statby(iris, measure.var = "Sepal.Length",
grps = "Species")
stable <- stable[, c("Species", "length", "mean", "sd")]
stable.p <- tableGrob(stable, rows = NULL,
theme = ttheme("mOrange"))
ggarrange(stable.p, text.p,
ncol = 1, nrow = 2,
heights = c(1, 0.5))
我稍加更改了这个来源的代码以适应我的需求。
提前感谢你!