saving sixway plots from R2MLwiN

Welcome to the forum for R2MLwiN users. Feel free to post your question about R2MLwiN here. The Centre for Multilevel Modelling take no responsibility for the accuracy of these posts, we are unable to monitor them closely. Do go ahead and post your question and thank you in advance if you find the time to post any answers!

Go to R2MLwiN: Running MLwiN from within R >>
Post Reply
Posts: 16
Joined: Mon Jun 03, 2013 3:19 pm

saving sixway plots from R2MLwiN

Post by andrewjdbell » Mon Aug 06, 2018 8:55 am

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 ( or in the sixway() function.


Posts: 1018
Joined: Mon Oct 19, 2009 10:34 am

Re: saving sixway plots from R2MLwiN

Post by ChrisCharlton » Mon Aug 06, 2018 9:15 am

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
sixway(mymodel1@chains[, "RP2_var_Intercept", drop = FALSE], "sigma2u0") # Replace with sixway call corresponding to you model

Post Reply