RStudio: Send package example code to Console

rstudio

#1

The help document of a package usually has some Examples. Can we select nay chunk of the example code and send it to the Console to run it?

Currently, right click the selection, there are two options: Copy, Inspect. I'd like to have another option: Run Selection.

I am so lazy to use 'Copy' and 'Paste'.

Thanks.


#2

With te preview version of Rstudio (1.2.1226-2) you can select the example and pres Ctrl + Enter


#3

Thanks Andresrce!:grinning:


#4

you can also just enter example(function) in the console


#5

Thanks. I normally just want to run a chunk of the code to test the results, not necessarily following the sequence of the example(function).

You've probably guessed I am a MATLAB user. Yes. In MATLAB, you can select any chunk of code in the help document and right click it to run it.


#6

This has actually been a feature since 1.1! :grin: See this earlier discussion :


#7

Just wish RStudio can go one step further, add it to the right key: right click the selection -> in the popup, add one more option "Run Selection" in addtion to the current two options: Copy; Inspect.


closed #8

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.