如何保存具有唯一文件名的 ggplot 列表?

问题描述

这是我当前用于保存不同 ggplots 列表的代码: 问题是它保存了所有不同的情节名称(raphael_2021_022.png 和 raphael_2021_023.png - 我想要的!)但每个唯一的 png 文件总是包含相同的 ggplot (raphael_2021_023.png),即使它有不同的名称

names(barplots_emmeans) <- 
  sub("\\.xlsx$",".png",names(raphael_calc_sum))
> barplots_emmeans
$raphael_2021_022.png
$raphael_2021_023.png

lapply(names(barplots_emmeans),function(nm) barplots_emmeans[[nm]] + 
         ggsave(filename = file.path("C:/Users/Raphael/Desktop/barplot_emmeans/",nm )))

我该如何解决

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)