Changing Interactive setting on already initialized R engine.

Apr 29, 2016 at 12:36 PM
Does anyone have a way to toggle the interactive mode of the R engine once it's been initialized?

I'd like to be able to have the ability for the user to interact with the engine and then disable it in subsequent calls.

My main issue is the plot window (device) appearing while processing R commands and I'd like to suppress it.
Apr 29, 2016 at 4:43 PM
The interactive window I use is "identify()"

Basically I do this;
openGraphWindow(rescale = 'fit')
plot(x)
identify(...)
graphics.off()

"openGraphWindow" <- function(...)
{
        winDevice = which(names(dev.list())=='windows');    # if no window device open a new one, else using the existing
        if (length(winDevice)<1) {
            #dev.set(1)
            windows(...)
            winDevice = which(names(dev.list())=='windows');
        } #else
            dev.set(dev.list()[winDevice]);
        default_PAR_settings();
}
Apr 29, 2016 at 11:55 PM
Thanks scubaskier.
I was more looking to be able to modify (toggle) the SetupParameters Interactive setting in the engine.

I may have to further investigate your method because when I use Rdotnet integrated with my application and the engine attempts to evaluate the line contains plot, I want to suppress that window from being displayed to the enduser and not to wait for user interaction.
May 2, 2016 at 5:13 PM

Hello midwestmaki,

I do not change the Interactive SetupParameter. I first call graphics.off()

Next I open one or more output devices (like pdf, png, etc.) and use dev.set() to direct the graph to the desired graphics format file.

I use sink() to redirect text output to a file as well.