Skip to the main content

RStudio

Extract a function from the selection

CmdOptionX

Mac Desktop app RStudio IDE

Practice this

In RStudio, Ctrl + Alt + X will extract a function from the selection. On a Mac, press Cmd + Option + X instead.

Where it works: Source editor

Every documented variant

Variants of this shortcut
System Environment Keys
Mac Desktop app CmdOptionX
Windows Desktop app CtrlAltX

Where this comes from

Keyboard Shortcuts in the RStudio IDE - Posit Support

Documentation checked on 2026-09-14. That is a documentation review, not a test run inside the application.

Report a correction