需先在系统中安装 R 3.4.0 以上版本,否则扩展无法工作;语言服务依赖单独安装的 languageserver R 包;首次使用会提示安装随扩展捆绑的 sess 包,需确认安装才能正常通信
install.packages("languageserver")
code --install-extension REditorSupport.rREADME 未说明硬件要求;需先在本机安装 R(>= 3.4.0),扩展本身运行在 VS Code 1.101.0 或更高版本中
在 VS Code 里写 R 的官方扩展,提供语言服务、终端交互、数据与图形查看
在 VS Code 里写 R 和 R Markdown 的官方扩展,提供语法高亮、代码补全、片段和交互式运行,省去在编辑器和 R 控制台之间来回切换。
核心能力
- 基于代码分析的 R 语言服务,支持补全、跳转、诊断与格式化
- 向 R 终端发送代码并管理多个终端和远程会话
- 分页可排序筛选的数据查看器,支持 data.frame、Arrow 与 polars
- 交互式图形查看器,支持 jgd 与 httpgd 后端及静态图回退
- 支持 R Markdown 分块高亮、执行与预览,并可运行 RStudio 插件
容易踩的坑
- v3.4.0最新正式版2026-11-09 · 2026-11-09 13:54 UTC
Release v3.4.0
What's Changed
- chore: bump serialize-javascript from 7.1.2 to 7.1.4 by @dependabot[bot] in https://github.com/REditorSupport/vscode-R/pull/1905
- chore: require VS Code 1.101 and remove legacy WebSocket compatibility by @eitsupi in https://github.com/REditorSupport/vscode-R/pull/1906
- perf: streamline R session refresh, replay, and console output by @renkun-ken in https://github.com/REditorSupport/vscode-R/pull/1908
- feat: install jgd into a vscode-R-managed tool library on demand by @eitsupi in https://github.com/REditorSupport/vscode-R/pull/1907
- feat: offer rstudioapi from the vscode-R-managed tool library by @eitsupi in https://github.com/REditorSupport/vscode-R/pull/1909
- fix: restore httpgd plot and local help rendering with EJS 7 by @renkun-ken in https://github.com/REditorSupport/vscode-R/pull/1911
- chore: bump oxlint-tsgolint from 7.0.2004 to 7.0.2005 in the dev-dependencies group by @dependabot[bot] in https://github.com/REditorSupport/vscode-R/pull/1917
- chore: bump oxlint from 1.88.0 to 1.89.0 by @dependabot[bot] in https://github.com/REditorSupport/vscode-R/pull/1919
- fix: improve editor responsiveness and session reliability by @renkun-ken in https://github.com/REditorSupport/vscode-R/pull/1921
- chore: bump follow-redirects from 1.16.1 to 1.16.2 by @dependabot[bot] in https://github.com/REditorSupport/vscode-R/pull/1924
- chore: bump ovsx from 0.10.12 to 1.3.0 by @dependabot[bot] in https://github.com/REditorSupport/vscode-R/pull/1925
- chore: bump ejs from 7.0.1 to 7.0.2 in the dependencies group across 1 directory by @dependabot[bot] in https://github.com/REditorSupport/vscode-R/pull/1916
- chore: bump qs from 6.16.0 to 6.17.1 by @dependabot[bot] in https://github.com/REditorSupport/vscode-R/pull/1920
- chore: bump js-yaml from 4.3.2 to 5.5.0 by @dependabot[bot] in https://github.com/REditorSupport/vscode-R/pull/1898
- chore: bump sinon and @types/sinon by @dependabot[bot] in https://github.com/REditorSupport/vscode-R/pull/1918
- ci: publish to VS Marketplace and Open VSX in independent, retry-safe jobs by @eitsupi in https://github.com/REditorSupport/vscode-R/pull/1926
- chore: update vsce to 4 and fix the msal-node advisory by @eitsupi in https://github.com/REditorSupport/vscode-R/pull/1927
- chore: prepare 3.4.0 release by @eitsupi in https://github.com/REditorSupport/vscode-R/pull/1928
Full Changelog: https://github.com/REditorSupport/vscode-R/compare/v3.2.1...v3.4.0
- latestDevelopment Buildpre-release2026-11-09 · 2026-11-09 13:48 UTC
查看更新说明
Contains the VSIX from the latest verified push to main.
- v3.2.22026-10-26 · 2026-10-26 14:38 UTC
查看更新说明
Release v3.2.2
Full Changelog: https://github.com/REditorSupport/vscode-R/compare/v3.2.1...v3.2.2
- v3.2.12026-10-24 · 2026-10-24 16:12 UTC
查看更新说明
Improvements and bug fixes
- Accepting a function or method completion that inserts parentheses now opens signature help, respecting
editor.parameterHints.enabled. (#1878) - Fixed session column completion in grouped and nested pipelines, including native R pipes and magrittr pipes. (#1901)
- Added an explicit Apply button and Blank option for filtering logical columns in the data viewer, including missing (
NA) values. - Fixed R Interactive plots disappearing during incremental output updates. (#1888)
- R Interactive execution timing now includes final output delivery and is retained across reconnects. (#1888)
Full Changelog: https://github.com/REditorSupport/vscode-R/compare/v3.2.0...v3.2.1
- Accepting a function or method completion that inserts parentheses now opens signature help, respecting
- v3.2.02026-10-15 · 2026-10-15 23:14 UTC
查看更新说明
Release v3.2.0
What's Changed
- fix: refresh extension debug builds and source maps by @renkun-ken in https://github.com/REditorSupport/vscode-R/pull/1782
- chore(release): 3.0.1 by @randy3k in https://github.com/REditorSupport/vscode-R/pull/1796
- feat: add sess.quiet option and fix duplicate prompt at startup by @grcatlin in https://github.com/REditorSupport/vscode-R/pull/1795
- chore(deps): bump brace-expansion by @dependabot[bot] in https://github.com/REditorSupport/vscode-R/pull/1778
- build(deps): bump fast-uri from 3.1.0 to 3.1.8 by @dependabot[bot] in https://github.com/REditorSupport/vscode-R/pull/1744
- build(deps): bump js-yaml by @dependabot[bot] in https://github.com/REditorSupport/vscode-R/pull/1746
- build(deps-dev): bump form-data from 4.0.5 to 4.0.6 by @dependabot[bot] in https://github.com/REditorSupport/vscode-R/pull/1808
- build(deps): bump ws from 8.19.0 to 8.22.0 by @dependabot[bot] in https://github.com/REditorSupport/vscode-R/pull/1807
- build(deps): bump picomatch from 2.3.1 to 2.3.2 by @dependabot[bot] in https://github.com/REditorSupport/vscode-R/pull/1810
- build(deps-dev): bump esbuild from 0.27.4 to 0.28.1 by @dependabot[bot] in https://github.com/REditorSupport/vscode-R/pull/1809
- build(deps-dev): bump lodash from 4.17.23 to 4.18.1 by @dependabot[bot] in https://github.com/REditorSupport/vscode-R/pull/1811
- build(deps): bump flatted from 3.4.1 to 3.4.4 by @dependabot[bot] in https://github.com/REditorSupport/vscode-R/pull/1812
- build: migrate JavaScript tooling to pnpm 11 by @eitsupi in https://github.com/REditorSupport/vscode-R/pull/1792
- Add
getRExecutablePath()to extension api by @ManuelHentschel in https://github.com/REditorSupport/vscode-R/pull/1813 - ci: gate releases on shared verification by @eitsupi in https://github.com/REditorSupport/vscode-R/pull/1814
- Fix configured library lookup before loading renv by @mihem in https://github.com/REditorSupport/vscode-R/pull/1797
- fix(session): skip hover and completion requests without an expression range by @jamalkamaladdin in https://github.com/REditorSupport/vscode-R/pull/1803
- chore: modernize issue templates by @eitsupi in https://github.com/REditorSupport/vscode-R/pull/1784
- feat: add native plot backend for R graphics devices by @eitsupi in https://github.com/REditorSupport/vscode-R/pull/1817
- Add persistent multi-session R Interactive windows by @renkun-ken in https://github.com/REditorSupport/vscode-R/pull/1805
- docs: clarify debugger recovery on VS Code 1.140 by @renkun-ken in https://github.com/REditorSupport/vscode-R/pull/1822
- feat: match bundled sess package by source snapshot by @eitsupi in https://github.com/REditorSupport/vscode-R/pull/1819
- fix(deps): patch serialize-javascript vulnerabilities by @renkun-ken in https://github.com/REditorSupport/vscode-R/pull/1823
- build: modernize TypeScript linting with Oxlint and TypeScript 7 by @eitsupi in https://github.com/REditorSupport/vscode-R/pull/1818
- fix: wait for managed R terminal session readiness before sending code by @eitsupi in https://github.com/REditorSupport/vscode-R/pull/1821
- Feature/list viewer 1399 by @Fred-Wu in https://github.com/REditorSupport/vscode-R/pull/1741
- test: streamline Interactive CI while retaining full OS coverage by @eitsupi in https://github.com/REditorSupport/vscode-R/pull/1826
- Make sess pure R while retaining arf Interactive sessions by @renkun-ken in https://github.com/REditorSupport/vscode-R/pull/1830
- chore: upgrade vscode-languageclient to 10.1.2 by @renkun-ken in https://github.com/REditorSupport/vscode-R/pull/1831
- fix: lower minimum VS Code version to 1.94.0 by @renkun-ken in https://github.com/REditorSupport/vscode-R/pull/1832
- ci: publish daily Marketplace pre-releases with odd minor versions by @eitsupi in https://github.com/REditorSupport/vscode-R/pull/1833
- ci(marketplace-pre-release): track daily pre-releases across manual and scheduled runs by @eitsupi in https://github.com/REditorSupport/vscode-R/pull/1834
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
R Extension for Visual Studio Code
This VS Code extension provides support for the R programming language, including features such as R language service based on code analysis, interacting with R terminals, viewing data, plots, workspace variables, help pages, managing packages, and working with R Markdown documents. See the wiki for full documentation.
The R and R Markdown syntaxes are located in a sibling package vscode-R-syntax.
What's new in 3.0.0
v3.0.0 is a major release with faster, more reliable R session communication,
powered by the sess package. The extension includes sess
and prompts to install or update the bundled copy when needed. Missing Imports
are installed from the configured R repository. See the changelog
for other changes and upgrade notes.
Quickstart
-
Install R (>= 3.4.0) on your system. On Windows, we recommend letting the installer write the R path to the registry.
-
Install the
languageserverpackage from R.install.packages("languageserver") -
Install the stable release of this extension from the VS Code Marketplace or the Open VSX Registry. This release requires VS Code 1.101.0 or later.
code --install-extension REditorSupport.rTo receive daily development updates, choose Switch to Pre-Release Version on the R extension's page in VS Code. New pre-releases are published to the VS Code Marketplace and Open VSX Registry when
mainchanges and verification passes. Choose Switch to Release Version to return to stable releases. When reporting problems, include the extension version and reproduction steps.Alternatively, you can test the latest development version by installing from GitHub:
The
latestpre-release is updated after successful verification of a push tomain. Download and install it:curl -fsSL -o vscode-R.vsix https://github.com/REditorSupport/vscode-R/releases/download/latest/vscode-R.vsix code --install-extension vscode-R.vsix -
Create an R file and start coding! (Click Yes if prompted to install
sess.)
Recommended extras
Steps 1–3 above are all that's required to get started with R in VS Code. But we also recommend the following software for a fully optimized R + VS Code experience:
-
Install an interactive plotting backend for a better R graphics experience:
-
arf: A modern R console with many features: syntax highlighting, multiline editing, vi/emacs keybindings, R version switching, etc. Successor to radian written in Rust.
-
Complementary VS Code extensions:
- Quarto: the official Quarto plugin for VS Code.
- VSCode-R-Debugger: enables VS Code's debugging facilities for R scripts.
For example, assuming that you have installed arf and jgd, your user settings.json might include:
{
"r.consolePath": "arf",
"r.bracketedPaste": true, // recommended for arf (and radian)
"r.plot.backend": "jgd" // "auto" already prefers jgd, then httpgd
}
Please consult the relevant installation wiki pages for your OS (Windows | macOS | Linux) for more detailed instructions.
Set r.plot.backend to "native" to use R's configured graphics device without
opening the VS Code plot viewer automatically. The "standard" backend continues
to display static plots in VS Code.
Features
-
Snippets for R and R Markdown.
-
R Language Service: Code completion, function signature, symbol highlight, document outline, formatting, definition, diagnostics, references, and more.
-
Interacting with R terminals: Sending code to terminals, running multiple terminals, working with remote servers.
-
Package development: Build, test, install, load all and other commands from devtools.
-
Keyboard shortcuts: Built-in and customizable keyboard shortcuts.
-
Workspace viewer: Environment pane to show global variables in the attached R session.
-
Help pages viewer: Viewing R help pages and searching help topics.
-
Package management: Installing and removing R packages.
-
Session symbol hover and completion.
-
Data viewer: Viewing data frames, matrices, Arrow tables, and polars data frames in a paged, sortable, filterable grid; lists in a tree view.
-
Plot viewer: Interactive plot viewer with support for jgd and httpgd backends, plus a standard PNG/SVG fallback.
-
Webpage viewer: Viewing htmlwidgets such as interactive graphics and visual profiling results.
-
Browser viewer: Viewing interactive shiny apps.
-
R Markdown support: R Markdown chunk highlighting, chunk navigation, execute commands, and preview.
-
RStudio add-in support: Run supported RStudio add-ins in VS Code with a live R session.
-
Full support of Remote Development via SSH, Containers and WSL.
Exploring data
Call View(x) to open a table. The viewer loads rows on demand and applies column filters and sorting in R across the full table.
- Columns searches column names, shows or hides matching columns, and pins columns to either edge. Drag entries to reorder them. Row names stay pinned on the left.
- Filters shows filter inputs below the headers. Press Enter to apply text and number filters; use the filter button for ranges, missing values, or combined conditions. Clear filters removes every column filter, including filters on hidden columns. The toolbar shows the matching and total row counts.
- Columns fit the available width by default and adapt when the viewer is resized. Size to content sizes the currently displayed cells, up to 480 pixels, and keeps those widths; Fit width switches back to filling the viewer. Manually resized columns retain their widths while the remaining flexible columns share the space. Hover over a cell to see its full value.
- Repeated
View()calls for the same object retain the viewer's sizing mode, column layout, sorting, filters, and page size when the column names, order, and types are unchanged. Refreshed data starts on the first page. Reset view restores fit-width sizing, the default layout, filters, sorting, and configured page size.
Questions, bug reports, ideas, and contributions
-
If you have a question, need help with setup or troubleshooting, or are unsure whether you have found a bug, please start a Q&A discussion.
-
If you have an idea for a new feature or behavior change, please start an Ideas discussion.
-
If you find a reproducible problem with the extension, please check the existing issues and then file a bug report.
-
Contributions are always welcome! Please see the contributing guide for more details.
Persistent R Interactive
This experimental feature provides native VS Code Interactive windows with independent arf sessions, including adoption of existing arf sessions over Remote SSH. vscode-R installs the bundled pure-R sess snapshot; missing Imports come from the configured R repository. Managed sessions retain streaming output, interruption, rich tables, HTML, and plots; notebook console input and debugger prompts are currently unavailable. See the setup and usage guide for session switching, persistence, rich outputs, and platform requirements.