Plots not working in for loop [duplicate]
问题 This question already has an answer here : Generate multiple graphics from within an R function (1 answer) Closed 1 year ago . I need to make a bunch of individual plots and want to accomplish this in a for loop. I am using ggplot2. I would just use the facet option if it could save each graph in a separate file, which I don't think it can do. There is something going on because the plots are not saved into the files. The files are generated, though, but are empty. Here is an idea of what my