我正在尝试在 R 中创建项目符号类型列表,并希望将其保存为 pdf 格式,这成功地在窗口上打印了项目符号列表:
a = paste0("Starting portfolio value: $", prettyNum(1000000,big.mark=",",scientific=F))
b = "Inflation assumptions of 3% annually"
c = "Average annual returns: 6%"
d ="Average annual volatility: 7%"
text = paste(a, "\n", b, "\n", c, "\n", d, "\n")
library(grid)
grid.points(x = rep(10,4), y = c(295, 318, 338, 360), pch = 15, gp = gpar(cex = 0.5))
grid.text(text, x = 0.05, hjust = 0, gp = gpar(fontsize = 11))
Run Code Online (Sandbox Code Playgroud)

但是,我希望能够将其与同一页面上的其他两个图表一起保存为 pdf 格式。
有什么办法吗?谢谢!