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.
With te preview version of Rstudio (1.2.1226-2) you can select the example and pres Ctrl + Enter
2 Likes
hoelk
January 14, 2019, 6:27am
4
you can also just enter example(function)
in the console
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.
jcblum
January 15, 2019, 5:34am
6
This has actually been a feature since 1.1! See this earlier discussion :
Hello,
I thought I remembered that there was a way to run example code from the help viewer pane in your R console using the IDE. But I can't seem to find anything about this online or on the IDE cheatsheet. Does it exist or am I imagining things? Obviously I can just copy and paste, of course, too.
Thanks,
Alison
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.
system
Closed
February 5, 2019, 1:26pm
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.