Enter
: Enter edit modeEsc
: Enter command modeShift + Enter
: Run cell, select belowCtrl + Enter
: Run cellAlt + Enter
: Run cell, insert belowCtrl + S
: Save and checkpoint
Up
: Select cell aboveDown
: Select cell belowA
: Insert cell aboveB
: Insert cell belowX
: Cut selected cellC
: Copy selected cellShift + V
: Paste cell aboveV
: Paste cell belowZ
: Undo cell deletionD, D
: Delete selected cellShift + M
: Merge selected cellsY
: Change cell to codeM
: Change cell to markdownR
: Change cell to raw1
: Change cell to heading 12
: Change cell to heading 23
: Change cell to heading 34
: Change cell to heading 45
: Change cell to heading 56
: Change cell to heading 60, 0
: Restart the kernel (with dialog)I, I
: Interrupt the kernelQ
: Close the pagerH
: Show keyboard shortcutsP
: Open the command palette
Tab
: Code completion or indentShift + Tab
: TooltipCtrl + ]
: IndentCtrl + [
: DedentCtrl + A
: Select allCtrl + Z
: UndoCtrl + Shift + Z
: RedoCtrl + Y
: RedoCtrl + Home
: Go to cell startCtrl + End
: Go to cell endCtrl + Left
: Move cursor left one wordCtrl + Right
: Move cursor right one wordCtrl + Shift + P
: Open the command paletteEsc
: Command modeCtrl + M
: Command modeShift + Enter
: Run cell, select belowCtrl + Enter
: Run cellAlt + Enter
: Run cell, insert below
Ctrl + 1
: Convert to heading 1Ctrl + 2
: Convert to heading 2Ctrl + 3
: Convert to heading 3Ctrl + 4
: Convert to heading 4Ctrl + 5
: Convert to heading 5Ctrl + 6
: Convert to heading 6Ctrl + M, M
: Convert to markdownCtrl + M, Y
: Convert to code
Ctrl + Shift + -
: Split cell at cursorCtrl + Up
: Move cursor to cell startCtrl + Down
: Move cursor to cell endCtrl + Shift + Up
: Select to cell startCtrl + Shift + Down
: Select to cell end
Ctrl + .
: Restart kernelCtrl + Alt + .
: Interrupt kernelCtrl + Shift + .
: Restart kernel and clear output
Using R with Jupter lab or notebook
The steps to use R with Jupyter Notebook are largely the same as for Jupyter Lab. Both Jupyter Notebook and Jupyter Lab rely on Jupyter kernels to support different programming languages, and for R, you use the IRkernel.
Summary:
To use R in Jupyter Notebook, follow these main steps:
OR using renv package manager:
renv::init()
renv
:renv
:renv::install("IRkernel")
Install the R kernel for Jupyter:
If using
renv
: Snapshot dependencies ->renv::snapshot()
Launch Jupyter Notebook:
In the Jupyter Notebook interface, select New > R to start a new R notebook.
Differences (minor):
So, the core setup (installing IRkernel) is identical. The only difference is in how you interact with the interface once the kernel is installed.
For both environments, ensure that your
jupyter
command is aware of the R kernel, which theIRkernel::installspec()
command handles.