我有一个关于 ggsave() 函数的问题,我将非常感谢任何帮助和/或建议/解决方案。我正在创建四个图并将它们全部放在一个大图中,因为我想使用数据框中的所有列循环整个函数,所以我想将创建的图保存在指定的文件夹中(最好使用标识名称)。
\n plotting_fun3 <- function(Q){\n \n plot1 <- plot_likert(\n t(Q),\n title = "Total population",\n legend.labels = c("strongly disagree","disagree", "neither nor", "agree", "strongly agree"),\n grid.range = c(1.6, 1.1),\n expand.grid = FALSE,\n axis.labels = c(" "),\n values = "sum.outside",\n show.prc.sign = TRUE,\n catcount = 4,\n cat.neutral = 3,\n \n )\n \n plot2 <- plot_likert(\n t(Q[survey$animal=="Dogs"]),\n title = "Female",\n legend.labels = c("strongly disagree","disagree", "neither nor", "agree", "strongly agree"),\n grid.range = c(1.6, 1.1),\n expand.grid = FALSE,\n axis.labels = c(" "),\n values = …Run Code Online (Sandbox Code Playgroud)