Will M
Will M

Reputation: 832

Shortcut to jump to a chunk in R Markdown?

Is there a shortcut to jump to a chunk in a R Markdown (on a Mac)? I'm looking for a way to quickly go between one chunk to another.

Upvotes: 6

Views: 1754

Answers (4)

Paul
Paul

Reputation: 576

Thesedays, there's a popup at the bottom of the source pane that gives an outline view and allows you to select chunks/sections.

Upvotes: 0

Kene David Nwosu
Kene David Nwosu

Reputation: 898

fn + Command + Up/Down works on the latest RStudio. It also jumps to heading sections.

Upvotes: 3

V Vulpes
V Vulpes

Reputation: 11

This preference option exists on the Mac desktop RStudio as well.

Upvotes: 1

henrik_ibsen
henrik_ibsen

Reputation: 813

I'm not completely sure this is possible on Mac, but in RStudio for Windows you can select to show the «document outline» in the IDE. Not really a shortcut perhaps, but it can easily be used to jump to different named chunks in the R Markdown document by clicking it.

enter image description here

By default, I believe the outline is set to only show «Sections» (i.e. ## Header here), so to enable it to show named chunks, go to Tools -> Global options -> R Markdown -> Show in document outline. Then set it to «Sections and Named Chunks»

enter image description here

Upvotes: 6

Related Questions