我有一个
list
包含六个情节,制作如下:
voi=c('inadist','smldist','lardist')
plist <- llply(voi,
function(v,df,s) {
list(
assign(
paste(v,'.violin'),
bwplot(groupname~df[,which(colnames(df)==v)]|fCycle*fPhase,
data=df,
groups=groupname, col=rainbow(1), box.ratio=3,
main=paste('Distribution of ', v, ' by Treatment and Cycle'),
sub=s, xlab=v, panel=panel.violin)),
assign(
paste(v,'.hexbin'),
hexbinplot(df[,which(colnames(df)==v)]~starttime|groupname,
data=df, xlab='Time(s)',main= paste('Distribution of ',v,' by Treatment'),
sub=s,ylab=v, aspect=0.5, colramp=redgrad.pal, layout=c(2,4)))
)
},data,meta$exp_name)
如果我把名单打印出来,
print(plist)
[[1]]
[[1]][[1]]
[[1]][[2]]
[[2]]
[[2]][[1]]
[[2]][[2]]
[[3]]
[[3]][[1]]
[[3]][[2]]
因为我正在编写一个webapp,所以我需要非常严格地控制控制台输出。到目前为止,在不输出索引的情况下输出绘图的唯一方法如下:
for(p in plist)
for(i in p)
print(i)
有没有更有效的方法得到我需要的?