Page 1 of 1

saving sixway plots from R2MLwiN

Posted: Mon Aug 06, 2018 8:55 am
by andrewjdbell
Hi Chris (sorry, me again!)

I'm trying to automatically save sixway plots from multiple R2MLwiN models - I'm running lots of models at once so don't want to do it by hand. When I try to use the sixway command, the plot seems to close down automatically after ~5 seconds, and won't let me save it. Any idea how one might do that? So far my colleague (and R guru!) has tried setting a device (such as png()), but this is ignored. He thinks there's a hard-coded clear device (dev.off() or dev.new()) in the sixway() function.

Thanks,
Andy

Re: saving sixway plots from R2MLwiN

Posted: Mon Aug 06, 2018 9:15 am
by ChrisCharlton
Hi Andy,

The following works for me:

Code: Select all

mypng <- function(filename="test.png", ...) {png(filename, ...) } # Replace test.png with a file name of your choice
options(device="mypng")
sixway(mymodel1@chains[, "RP2_var_Intercept", drop = FALSE], "sigma2u0") # Replace with sixway call corresponding to you model
dev.off()