Save time in RStudio with this shortcut⏰
videoimage: thumbnail.jpg
Transcript#
This transcript was generated automatically and may contain errors.
Get ready because this RStudio shortcut tip will save you so much time. Do you ever find yourself re-running the same chunk of code over and over again, slightly modifying it each time? Say some data manipulation task where you're building a plot in which you're iterating as you slowly build it up. For years I'd run my chunk, edit it, and then use my mouse to re-select that code chunk to run it again.
You don't need to touch that mouse. Or trackpad. Or little red ball thingy.
Here's a quick example. I select this range of code, run it, creating this plot. Then I realized I wanted to make a bunch of changes. Refining the plot, adding labels, fixing bugs. As I'm iterating and I want to check how these changes look in the new plot, all I have to do is run my new shortcut.
This shortcut will run the same region of code over again, even if you've edited it or expanded it. And what do we mean by region exactly? Even if you add new lines of code, the shortcut will automatically pick those up.
This shortcut will run the same region of code over again, even if you've edited it or expanded it.
And that's Command Option P on a Mac or Control Option P on Windows. And follow for more Posit Tips like this.
