This article assumes that you have RTVS extension added to your VS IDE. You can refer my previous blog on installation & configuration of RTVS.
Prerequisites: 1. Basic knowledge of R programming 2. RTVS Extension
Once you install ‘Data Science and Analytical Applications’ workload using VS2017 installer (May 2017 update), new R Project template will be available for creating new project.
Those who are familiar with R Studio will certainly find themselves home with this IDE. Additionally we have all VS native features. Given below is a view that shows Solution Explorer, Script file (Script.R) and Interactive Window (Microsoft R Client which is equivalent to console in R Studio)
Notice that there is an ‘R Plot’ tab which is where the plots/visualizations will be generated.
To start with lets draw a basic plot
ds <- c(1,500,300,100,350) plot(ds)
Alternately use the normal VS debug (starting new instance) and watch the interactive window as the plot is generated.
ds <- c(1,500,300,100,350) > plot(ds) > rtvs::debug_source("~/visual studio 2017/Projects/rproject1/rproject1/script.R") Sourcing: c:\users\geek2\documents\visual studio 2017\Projects\rproject1\rproject1\script.R >
That’s basic start. I recommend R developers to explore the VS menu “R Tools” for the complete set of R integration options available.