R - Assigning Plot to Variably Named List
问题 I am trying to assign a plot to a list that is named via variable ( snm ). My code snippet is all the variations that I tried to do to make it work. What other option am I missing? Thanks. My goal is to loop over my graph assignments, using an IF statement to change the snm and a few other variables that I will use in the graphs. for (x in seq(0,1)) { if (x==0) { snm="grad" } else if (x==1) { snm="start" } assign(snm,list(),envir=.GlobalEnv) #works assign(snm[[1]],ggplot(data=TDSF, aes(x