문제

in R there are several ways to wait for an input from the user, such as clicking somewhere on a graph (e.g. locator() function).

I'm looking for an option to record the user input WITHOUT waiting for it. I'm running a for loop with a locator() function in it, but this function prevents the for loop to progress unless the user click on something.

Any idea on how to overcome this?

도움이 되었습니까?

해결책

Your best option is probably to use another GUI toolset, tcltk is one option. You can create a plot and display it in a Tk window, then set up a handler that will change a variable value if the user clicks on the plot, then you can have your loop doing other calculations and just check periodically if the variable set by the handler has changed.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top