How to show R graph from visual studio code

Viewed 12361
3 Answers

Please try the latest vscode-R Session Watcher. Plot, htmlwidgets, shinyapps, View(data.frame), help documentation, etc. all can be shown in VSCode.

It looks like its opening an external graphics window. Try putting

windows();plot(stuff)

This explicitly pushes the plot to an external window

Now it is possible.

Step 1:

a) Install httpgd from CRAN or github. From CRAN,

From CRAN:

install.packages("httpgd")

From GitHub:

devtools::install_github("nx10/httpgd")

b) Install languageserver:

install.packages("languageserver")

Step 2:

Install R extension for vscode

Step 3:

From vscode setting, select R > Plot: Use httpgd to use for R plot.

They have done a amazing job with R extension. We can view data.frame and list in a separate data viewer in vscode.

Related