Hi, Programming for R (stats package) the user often wants to select a whole function (usually in order to execute it in R)
my fun <- function(param,..){ # your code }
cmd-shift-B will select the next-out level of brackets, and, if repeated, will eventually select the outer-most brackets. But to execute the function, one needs to select the whole of that first line of the function definition.
Is there a command to do that?
the command would function like repeated executions of cmd-shift-B until the there is no outer bracket to find, then expand the selection to include ^ of the first line
Hi,
Programming for R (stats package) the user often wants to select a whole function (usually in order to execute it in R)
my fun <- function(param,..){ # your code }
cmd-shift-B will select the next-out level of brackets, and, if repeated, will eventually select the outer-most brackets. But to execute the function, one needs to select the whole of that first line of the function definition.
for me a macro works recorded as:
cmd-shift-B cmd-shift-arrow_left
Cheers, Hans
Hi Hans (and Thank you writing the R Bundle!)
Perfect! I recorded 4 cmd-shift-Bs to ensure getting to the outside of the function.
I think adding it to R.tmbundle would be useful for several users. I saved mine as opt-cmd-shift-B
t
for me a macro works recorded as: cmd-opt-M cmd-shift-B cmd-shift-arrow_left cmd-cntrl-M
Cheers, Hans
On 23 Apr 2019, at 10:54 am, mail@bibiko.de wrote:
Programming for R (stats package) the user often wants to select a whole function (usually in order to execute it in R)
my fun <- function(param,..){ # your code }
cmd-shift-B will select the next-out level of brackets, and, if repeated, will eventually select the outer-most brackets. But to execute the function, one needs to select the whole of that first line of the function definition.