Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>R NotebookNew to Visual Studio Code? Get it now.
R Notebook

R Notebook

Zitian(Andy)Wang

|
646 installs
| (0) | Free
Native .Rmd, .qmd, and .ipynb support with inline console, plots, and paginated data frames
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

R Notebook

R Notebook is a VSCode extension (https://marketplace.visualstudio.com/items?itemName=zitiansunsh1ne.r-notebook) for .Rmd, .qmd, and .ipynb workflows with in-line execution, notebook-style outputs, plots, and session-aware tooling for R/Python data science analysis.

New in 1.6.0

  • Single-save fix: Saving no longer feeds serializer formatting back into the notebook as a new edit. Custom R Markdown output state is included before the save completes. New edits or execution output arriving after a save can still correctly mark the file dirty.

  • Interactive 3D object rendering: Plotly figures appear in their own output tabs alongside dataframes and images. Rotate 3D scatter, surface, and mesh plots, zoom, pan, and inspect points with hover. Plotly 2D figures are supported too, in both the native notebook and R Markdown editor views.

  • Bug fixes: Preserve outputs when saving large R Markdown notebooks while multiple notebooks are running. Package installation console output retains compiler stdout, stderr, and the final output lines.

  • Dataframe cell copying: Select a cell, then right-click Copy cell value or press Cmd+C on Mac / Ctrl+C on Windows and Linux.

  • Performance: Avoid unnecessary recovery checkpoints for conservatively recognized read-only expressions, and move large native R Markdown/Quarto serialization into a worker.

Jupyter notebook compatibility

.ipynb execution uses IPython when it is installed in the selected Python environment. This supports line/cell magics such as %matplotlib inline, %time, %%timeit, and %pip, shell escapes, top-level await, display(), and rich object representations. Install the execution dependency in that environment with python -m pip install ipython; Matplotlib, Plotly, and other display libraries remain dependencies of your analysis.

Standard notebook outputs are displayed in order using their MIME bundles, including PNG, JPEG, GIF, SVG, HTML, and Plotly JSON. MIME alternatives and output metadata are retained. Saved notebook outputs, raw cells, Markdown attachments, cell IDs, execution counts, and saved widget metadata survive save/reopen. Clearing an output no longer restores stale data from cell metadata. Plotly figures from existing Jupyter notebooks are interactive without rerunning the cell.

In .ipynb, rich outputs use the standard notebook output area; .Rmd/.qmd retain their output tabs. clear_output(wait=True) and display-ID updates are supported. Unchanged output items are reused during console streaming.

Live widgets: Full ipywidgets, ipympl (%matplotlib widget), and other kernel-connected components require the Jupyter extension and an appropriate Jupyter kernel. Run R Notebook: Open in Jupyter to save and reopen the current .ipynb in that host. This does not change your default file associations. The lightweight R Notebook kernel does not implement Jupyter widget communications. Other rich MIME formats use compatible installed VS Code renderers; HTML/JavaScript behavior follows their trust and rendering rules. Standard MIME data and saved widget state are preserved even when a matching renderer is unavailable.

Interactive Plotly output

With the R plotly package installed, evaluate the figure as an expression in a code cell:

p <- plotly::plot_ly(
  x = 1:10, y = (1:10)^2, z = sqrt(1:10),
  type = "scatter3d", mode = "markers"
)
p

Or display a surface:

plotly::plot_ly(z = volcano, type = "surface")

In a Python notebook with plotly installed, return a figure as the final expression or call fig.show():

import plotly.graph_objects as go
fig = go.Figure(go.Scatter3d(x=[1, 2, 3], y=[3, 1, 2], z=[2, 4, 1], mode="markers"))
fig.show()

In .Rmd/.qmd, select the Interactive plot output tab. In .ipynb, interact with the figure directly in the output area. Rendering uses a bundled Plotly library, so standard 3D plots require no CDN connection. Figure data is retained in saved notebook outputs. Unchanged plots retain their viewing angle during streamed console refreshes. The renderer loads on demand and releases resources when a plot is removed.

3D interaction requires WebGL support in VS Code. The bundled 3D renderer supports Plotly figures. See Jupyter notebook compatibility above for other HTML and widget outputs. Static HTML/PDF export includes a notice for these figures; open the notebook for interactive viewing. Camera movements are view state and are not written back into saved figure data.

Features

  • Native .Rmd, .qmd, and .ipynb support with in-line execution and notebook controls
  • In-line console output, plot rendering, and ordered multi-output display
  • Session controls for selecting, restarting, and interrupting kernels
  • Session variable inspection for active notebooks
  • Multi-session support so separate notebooks can keep their own runtime state
  • Paginated data-frame viewing for larger tabular outputs
  • Built to work well alongside AI-assisted editing workflows

AI Editing Support

R Notebook works well with AI-powered editing and review tools, including GitHub Copilot, Cursor, and Antigravity. You can keep an .Rmd or .qmd notebook open, ask an AI tool to revise analysis code or documentation, and continue executing chunks with the same in-line notebook experience.

Preview

Editing code with Cursor

Editing code with Cursor

In-line image rendering

In-line image rendering

In-line data-frame viewing

In-line data-frame viewing

Detailed console output

Detailed console output

Detailed error panel with Traceback

Detailed error panel with Traceback

Multiple R sessions

Multiple R sessions

Build From Source

npm install
npm run build

Package

npm run package

Version 1.6.0 packages into the project root as r-notebook-1.6.0.vsix.

Select a dataframe cell and right-click Copy cell value, or press Cmd+C (Mac) / Ctrl+C (Windows/Linux). Package installation output includes compiler stdout and stderr in the console and saved results.

Performance update: simple read-only inspections reuse the current recovery checkpoint. Large native .Rmd/.qmd notebook serialization runs in a worker; custom-editor persistence, live output serialization, and .ipynb serialization still use their existing paths. Unknown calls remain conservatively checkpointed.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft