Although I find Rstudio excellent, I have some problems with automatic switching back to the source pane. A typical example would be that I am creating a script, lets say it contains (from ?lm):
ctl <- c(4.17,5.58,5.18,6.11,4.50,4.61,5.17,4.53,5.33,5.14)
trt <- c(4.81,4.17,4.41,3.59,5.87,3.83,6.03,4.89,4.32,4.69)
group <- gl(2, 10, 20, labels = c("Ctl","Trt"))
weight <- c(ctl, trt)
lm.D9 <- lm(weight ~ group)
Then I want to check something inside the lm function with debug from console:
debug(lm)
lm.D9 <- lm(weight ~ group)
...
Browse[2]> Q
After I finish browsing with Q, the focus automatically changes back to the source, even if I have already been working in the console for a while. This can be quite annoying as selected text in the source pane will be deleted when I touch any key. And this might go unnoticed if I am concentrated on what I wanted to do in the console and I switch back without checking what happened with the source.
After some googling, I thought this might be changed with
Options/Code Editing/Focus console after executing from source
However, the focus did still switch back to the source after ending the browser!
Any ideas how to turn off this behavior? I think (could be wrong) that this was different in the earlier version I had of Rstudio. My current is 0.98.978.