Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

interactive() is problematic for "my" typical usecase #11

Closed
kostrzewa opened this issue Apr 21, 2015 · 8 comments
Closed

interactive() is problematic for "my" typical usecase #11

kostrzewa opened this issue Apr 21, 2015 · 8 comments

Comments

@kostrzewa
Copy link
Member

They way I use R makes the usage of interactive() a bit problematic. My analysis drivers have loads of parameters in order to be suitable for different analyses (as far as that is possible) and as a result I generally run them from an interactive session. It would be helpful for me if interactivity as a reason for calling X11() to get new windows could be an internal state rather than what is reported by interactive(). What do you think?

@urbach
Copy link
Member

urbach commented May 7, 2015

so you mean an additional parameter?

I usually run Rscript...

@kostrzewa
Copy link
Member Author

I usually run Rscript...

That doesn't really work for me since my drivers are themselves functions, I guess I could write further R scripts which call the drivers, rather than calling them "interactively". I guess that would even be a good way to keep track of the exact parameters used for a given analysis. Lemme think about it and I'l get back to you.

so you mean an additional parameter?

I guess so, but more usefully it could also be done through the options() framework, with the default as TRUE and this can then be handled locally for the various cases where you've used interactive()

if( (is.null(getOption("hadron.interactive")) || getOption("hadron.interactive")) && interactive()) { x11() }

or something like that. The is.null() would ensure backwards compatibility.

@kostrzewa
Copy link
Member Author

I would really like to re-iterate this point. I don't think that a plot routine should open new devices...

@urbach
Copy link
Member

urbach commented Jul 17, 2017

I don't see, why not. There is no other way to have multiple X11 plots opened by a single plot function. However, I see your point. So, what about something like the following additional condtions to interactive()

grepl("X11", names(dev.cur()), ignore.case=TRUE) || grepl("null", names(dev.cur()), ignore.case=TRUE)

to only open a new window if there is no other driver used than X11?

@urbach
Copy link
Member

urbach commented Jul 17, 2017

See commit 82aed14 ...

@urbach
Copy link
Member

urbach commented Jul 17, 2017

in urbach/hadron master branch

@urbach
Copy link
Member

urbach commented May 24, 2018

this is fixed now, isn't it?

@kostrzewa
Copy link
Member Author

Yes, I think so, I'll close the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants