Interactive viewers - REditorSupport/vscode-R GitHub Wiki
With R session watcher enabled, multiple types of viewers are supported to display tabular data, graphics, htmlwidgets and shiny apps.
Data viewer
View()
will open a tab to view the object.
Object type | Viewer |
---|---|
data.frame |
table viewer |
matrix |
table viewer |
list |
list viewer |
environment |
table viewer |
others | text editor |
And, Apache Arrow Table
will be converted to a data.frame
and then displayed in the table viewer.
Table viewer
The table viewer supports sorting and searching.
List viewer
The list viewer supports collapsing nodes.
Plot viewer
Graphics could be displayed in native X11/XQuartz window, or as a PNG file in VS Code window, or in a plot viewer based on httpgd device. For more details, go to https://github.com/REditorSupport/vscode-R/wiki/Plot-viewer.
Webpage viewer
In R, an htmlwidget is written in HTML and can be presented in a web browser. For example, the following image demonstrates an interactive graphics created by plotly:
Browser viewer
Interactive shiny apps can be displayed in VS Code. The following is an example created by
shiny::runExample("01_hello")
For security reasons, the VS Code WebView has security limitations on its capability of accessing external resources over a network. For more details, visit WebView API.
If you encounter a problem loading a webpage in a browser viewer, you may try viewing the web page in an external web browser.
Help viewer
The web pages in R documentation can be viewed in the help viewer. Syntax highlighting and link navigation are supported.
Help viewer could be revealed via ?symbol
in R terminal, or from the
Help pages viewer
in the
sidebar,
or via command R: Open help for selection
in either command palette or context
menu in the editor.