I am trying to create and save multiple plots with qgraph()
. So far I tried:
for (i in 1:100){
png(paste(i,".png",sep="_"))
qgraph(l[[i]])
dev.off()
}
l
is a list of 100 weight matrices.
Creating a plot outside of the for loop works without problems.
The for loop also works with with plot()
, instead of qgraph()
.
Alternatively I used:
qgraph.animate(l,progress=FALSE)
Using qgraph.animate()
creates 100 plots. Is there a way of saving them? This would also have the benefit of being able to use constraint argument.