简体   繁体   English

如何在图的名称中使用列表名称?

[英]How to use a list name in the name of the figure?

I have created several list enviroments. 我创建了几个列表环境。 Then I wrote a function to draw several figures from the stored data and I would like to use a list name as a part of figure name. 然后,我编写了一个函数,用于从存储的数据中绘制多个图形,并且我想使用列表名称作为图形名称的一部分。

list_xName <- list(aa = 1:10, bb = exp(-3:6), cc=-3:6)  
drawL<-function(list_xName){
plot(list_xName$aa,list_xName$bb)
savePlot(filename=paste("fig_",xxxxxxx,sep=""),type="eps")  
}  

Instead of 'xxxxxxx' in savePlot I would like to have a name of the list. 我想使用列表的名称代替savePlot中的“​​ xxxxxxx”。

I hope that my question is understandeble enough. 我希望我的问题是可以理解的。 Thank you in advance. 先感谢您。

尝试deparse(substitute(list_xName))

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM