Use variable name as plot title with lapply

拜拜、爱过 提交于 2019-12-06 11:01:20

You are right about those variable names coming from lapply. So that deparse strategy isn't a good one in that case. But since you made it super easy to pass along the title, you can just use Map rather than lapply.

graphs_list <- Map(make_graph, mget(sample_list), sample_list)
do.call("grid.arrange", graphs_list)

This gives the desired result.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!