[TxMt] Re: Re-send previous code block to R console

Hans-Jörg Bibiko bibiko at eva.mpg.de
Thu Mar 6 19:18:44 UTC 2014


Hi Ross,

On 06 Mar 2014, at 19:44, Ross Ahmed <rossahmed at googlemail.com> wrote:

> Let's say I'm working in a .R file on this block of code:
> 
> mtcars_sub <- subset(mtcars, cyl == 6)
> mtcars_lm <- lm(mpg ~ disp, mtcars)
> summary(mtcars_lm)
> 
> I highlight the block of code and send it to the R console. Following this, I then edit the code block (predictor added to model), so it becomes:
> 
> mtcars_sub <- subset(mtcars, cyl == 6)
> mtcars_lm <- lm(mpg ~ disp + wt, mtcars)
> summary(mtcars_lm)
> 
> Can I send the edited code block to the R console, using a keyboard shortcut, without having to go back and highlight it? This feature is implemented in RStudio and is something I miss after having switched to TextMate. 

well, this kind of feature isn't implemented. Here arises one question: How do you define the "previous code block"? In terms of lines, or of the begin- and end-characters?

I do not know RStudio very well but maybe I can figure out how it defines it.

On the other hand, did you try the Rdaemon, which means to run R within a normal TextMate editor window (with ALL the TM features)? I find this way to work with R very powerful. Ok, firstly you will be a bit confused that this kind of a R-console is "non-linear in time" meaning you can go up lines, edit stuff and re-run code from there, but it turned out (also on basis of many users) that the Rdaemon opens unforeseen possibilities.

If not, simply set a TM window to R Console (Rdaemon), read the Help, and then type into an empty line "start" and press TAB. 

Cheers,
Hans



More information about the textmate mailing list