
Announcing R Tools for Visual Studio - brettcannon
https://blogs.technet.microsoft.com/machinelearning/2016/03/09/announcing-r-tools-for-visual-studio-2/
======
smortaz
Hi folks - Last year we polled HN on whether there'd be interest in R
integration in Visual Studio. You said "YES!", so here it is! I'll be around
in case you have any questions.

BTW RTVS was built by the same group that made PTVS (Python Tools for VS) and
NTVS (Node.js Tools for VS). RTVS will also be free & open source of course.

Cheers

~~~
crispyambulance
I welcome RTVS, but as an Rstudio user, I am now curious about what things are
_substantially_ different between the two. They're, at least superficially,
very similar.

In other words, why would an Rstudio user consider a switch to RTVS?

~~~
smortaz
RStudio is a _fantastic_ IDE. It's been under development for years by some of
the smartest ppl in the R community. it's currently decidedly better than
RTVS. There are things here & there that RTVS might be better at, but this mvp
was mostly about getting the heart-lung "IDE" features out. Some things you
get w RTVS (partly courtesy of VS are):

* Multi-lingual: projects w C#, Python, SQL, etc.

* Multi-line repl: recall/edit/submit chunks of code

* Lots of add-ins: like 6,000 (hopefully a few are useful for R!)

* Upcoming integration w Excel, Azure ML, SQL, etc.

* etc.

If you are already a VS user, checking out RTVS is a no brainer.

But in summary, RStudio is better :). Hopefully we'll have some key
differentiation features in upcoming releases.

~~~
mistermann
Could you expand a bit on what the nature of integration with Excel might be?

~~~
smortaz
Sure. It can go from very basic:

* Right click on a data frame & "Open in Excel" (to view, chart, massage, etc.) but one way

to something more elaborate like we did for PTVS/Pyvot (two way):

* [https://www.youtube.com/watch?v=Gu31s7kXPOg](https://www.youtube.com/watch?v=Gu31s7kXPOg)

to

* Using R as a scripting language in Excel, edited/debugged in RTVS (poke the Excel team pls ;))

to

* <your brilliant idea here!>

~~~
mistermann
> Using R as a scripting language in Excel, edited/debugged in RTVS (poke the
> Excel team pls ;))

I imagine the Excel team is well aware of how embarrassingly weak the VBA
language and Excel object model "quirkiness" is in the year 2016. I simply
can't understand why they continue to let such a key platform languish.

------
Gratsby
Microsoft is trying really hard to get me to like them again. It's starting to
work.

------
Mikeb85
While I'm somewhat ambivalent about Windows-only tools, it's nice to see R
getting love from all the big players. The more market share and developers
using it, the more the tools and implementation improves, and the better for
all of us. Just finished an assignment using R Studio, Knitr and Plotly, so
much less pain than Excel+macros or Stata.

~~~
marrone12
I also vastly prefer R to Pandas, where the same functionality for plyr seems
awfully verbose and unclear.

~~~
eruditely
I definitely prefer R to pandas, dyplr and tools were soo much easier to use
for subsetting dataframes and dealing with them, initially I thought python
might be better because it was supposed to be easier, but boy was I wrong.

~~~
pbowyer
Thanks for mentioning dyplr. I've been struggling with pandas (can a library
be more convoluted?) and will definitely give R a go.

~~~
eruditely
Yeah out all the assorted packages that go with that, tidyr too.

Here's a cheat sheet [https://www.rstudio.com/wp-content/uploads/2015/02/data-
wran...](https://www.rstudio.com/wp-content/uploads/2015/02/data-wrangling-
cheatsheet.pdf)

------
hirenj
This definitely looks like something I need to check out. I do a lot of one
off analysis for small bioinformatics projects,and I've taken to sharing
results in the Microsoft ecosystem via OneNote. I've wrapped knitr into my own
library (knoter) which generates the html and figures, and pushes the whole
lot up to OneNote in the selected notebook. OneNote works well for this kind
of collaborative analysis, where I need to keep track of the whole discussion
somewhere.

One thing I'm missing from my workflow would be a way to integrate in to an
IDE so I just push a button, and it'll commit the code to a gist, and push the
output to a OneNote for other people to comment on. I'm wondering if it would
be possible to fork this, and tweak the calls to knitr so they use my library
instead.

~~~
smortaz
Brilliant idea! We do take PR's :)

------
melling
Does anyone have a short list of the best sites to learn R? I only have two on
my list, and one is for advanced users:

[http://adv-r.had.co.nz](http://adv-r.had.co.nz) \- Advanced R by Hadley
Wickham

[https://learnxinyminutes.com/docs/r/](https://learnxinyminutes.com/docs/r/)

I keep my links on Github:
[https://github.com/melling/ComputerLanguages/blob/master/r.o...](https://github.com/melling/ComputerLanguages/blob/master/r.org)

~~~
hadley
This is my more intro level book:
[http://r4ds.had.co.nz](http://r4ds.had.co.nz) (it's still a work in progress,
but you might find it helpful)

------
kefka
That's what I never understood about Microsoft. They're a software company.
And some of it is absolutely horrible (Sharepoint), and some of it is the best
in the business (Visual Studio).

There's a significant mindshare in Linux and Open Source. That being said, I
don't understand why MS didn't provide Visual Studio, Office, and similar for
Linux at a premium. For example, if Office was $499 for Windows, charge $999
for Linux. That way, they get the best of both worlds (use their software, pay
them money). And their mindshare is significant as well, and this would
increase it.

Maybe finally they are coming to their senses, doing just this. It's about
time.

~~~
signal11
Technically speaking, Office already runs on a Linux platform -- Android. In
fact, if you subscribe to Office 365, they almost* don't care where you run
it, they're still being paid.

* = I suspect the reason behind not creating Office for Linux desktop is that: non-Android Linux desktops have too little market share to be worth the engineering effort / risk of cannibalizing Windows desktop sales. Whereas Android has huge market share and people were perfectly comfortably using Android even without Office. So in that narrow case it made sense to go where the users are.

And they can say that on Linux desktops, you can use a very compatible version
of Office inside a browser.

------
tyfon
I got to test this tomorrow at work, however loading up a huge program instead
of a web page where all the stuff is stored on a server is going to require
some changes in behavior.

And I usually work from Linux, so it will be in a VM. But I'll try :)

~~~
smortaz
Understood. RTVS itself is 3MB's. Hopefully you won't have to install VS more
than once or twice a year as it's several Gigs...

Speaking of a web page, our team also did "Jupyter notebooks as a Service" on
Azure ML. You can fire up a notebook quickly and code away - essentially like
tmpnb if you've used it, but your notebook is persisted.

we'll be adding more languages soon. Try one of the samples at: (no login), or
start w blank notebook in the Azure ML Studio:

[https://gallery.cortanaanalytics.com/browse/?categories=[%22...](https://gallery.cortanaanalytics.com/browse/?categories=\[%22Notebook%22\])

~~~
tyfon
Thank you, I will.

Is it easy to connect these to local data sources or do I have to upload csv's
or something similar? Being a bank we store data locally in both PostgreSQL
and MS SQL, although we are considering moving some stuff to Azure anyway.
Just have to clear it with the legal guys!

I guess I can make a quick export of non personified data for testing though.

~~~
smortaz
For Azure ML, some people use it fully in the cloud, others do local work in
their favorite IDE, usually RStudio, then upload scripts, do their training,
opertionalization, etc. on Azure. If you are using standard R, Python (eg
scikit-learn) you can do work locally or on AzureML, but if you want to use
Azure ML's own algos, then they're available only on the cloud.

There are also some sample experiments + data on Azure ML that you can check
out quickly (no log in):

[https://gallery.cortanaanalytics.com/experiments](https://gallery.cortanaanalytics.com/experiments)

------
stevehiehn
Sweet, If this works on the free community edition I'm gonna try it for sure.

~~~
smortaz
It definitely does! In fact with the Community Edition it becomes a
perpetually free R IDE.

edit: see gnoway's comment below tho.

~~~
gnoway
* For personal use, or organizationally for academic purposes, classroom learning and open source projects only. Or if your company has <250 PCs or <$1mm in annual revenue, up to 5 people in your organization can use Community.

[https://www.visualstudio.com/support/legal/mt171547](https://www.visualstudio.com/support/legal/mt171547)

~~~
smortaz
Correct, CE version has restrictions. It's great for checking out RTVS to
decide if you want to upgrade to Pro/Enterprise.

~~~
r0muald
Which kind of defeats the fact that RVTS is free and open source, but is still
fundamentally understandable in terms of Microsoft's strategy in this area.

~~~
nightski
It doesn't defeat the fact at all. The number of users who can now use it for
free is much greater than before (zero).

------
markbao
This looks stunning. Anyone know how it compares to RStudio? I might
virtualize Windows to use this.

------
namelezz
Why not Visual Studio Code?

~~~
smortaz
An excellent question! Please take this survey so our mgmt hears you :)

[https://www.surveymonkey.com/r/RTVS1](https://www.surveymonkey.com/r/RTVS1)

------
swalsh
Stupid question, is it possible to take an R script and compile it to a .net
CLR dll?

~~~
localhost
No, and not a stupid question at all :) This isn't an "IronR", rather RTVS
simply calls out to whatever R interpreter that you have installed on your
machine (and that is configurable if you like switching between different
interpreters / versions).

------
TheLogothete
Bring the VCF from Azure ML to Visual Studio! I said it in the survey too. VCF
is very important in some settings. Being able to code R + SQL and have
workflow components in the same environment would be a killer feature.

~~~
smortaz
I _think_ you are referring to WCF? Basically being able to create a model,
then operationalize it on the cloud for mass usage?

If so, the good news is that you can do that with RTVS, thanks to the R SDK.
Basically you create models locally, test/debug them, then zap that onto Azure
ML's backend. The SDK itself isn't tied to RTVS in any way. You can use it
from RStudio, Jupyter/R, vim, ... if you like.

R SDK:
[https://cran.r-project.org/web/packages/AzureML/index.html](https://cran.r-project.org/web/packages/AzureML/index.html)

Regarding your 2nd question - RTVS/SQL integration - yes, that's definitely
coming too. For this initial release we just wanted to make sure we got the
core IDE functionality right...

~~~
TheLogothete
No, I mean Visual Composition Framework (it's a Gartner name). It is drag and
drop components just like Rapid Miner, Alteryx, KNIME or Azure ML. However the
tools that perform those things now are standalone and I have to switch
between 5 or so different tools to get my job done.

Kind of like SQL Server Integration Services but instead of SQL Server, target
Azure ML.

~~~
smortaz
Aha, my bad. Yes, for certain scenarios it makes sense to have a drag/drop
paradigm, for some a REPL++ like Jupyter, and sometimes an Editor. That's
exactly why we decided to integrate Jupyter w Azure ML. This is going the
other way around and makes total sense. The ideal as you've noted is figuring
out how to integrate the three canvases intelligently so that you don't have
to "alt-tab" between disjoint worlds constantly. Meanwhile I've added it to
the feature list:

[https://github.com/Microsoft/RTVS/issues/1237](https://github.com/Microsoft/RTVS/issues/1237)

------
myth_drannon
Looks like a promising alternative to Rstudio on a Windows platform. If only
it was available on Linux...

~~~
reddygaru
Visual Studio will be coming to Linux

~~~
smortaz
There are no such plans. But we have VS Code, which is great lighter weight
IDE that's cross platform. Check it out here:

[https://code.visualstudio.com/](https://code.visualstudio.com/)

It has great support for js, node, go, .net etc. already. We'll hopefully add
Python & R support soon.

~~~
BinaryIdiot
I've heard a great number of rumors regarding bringing Visual Studio (full) to
Mac OS X and Linux. Many from Microsoft folks. Not saying they have to be true
but I should be shocked if it wasn't at least being researched and looked at.

~~~
smortaz
Personally speaking I would _love_ for that to happen. There is room for both
an XL IDE and a XS IDE imho.

------
karazi
Any plans for a 32 bit version? We need our 32 bit R studio install to be able
to run in parallel with this as we test this and we cannot switch Java
versions from 32 to 64 bit which some pkgs we use require. Congrats on the
public release.

------
_Wintermute
Might try this out as I've had nothing but issues with the Windows version of
RStudio.

------
eruditely
Microsoft is getting better and better, this is the rise of a new company.

------
vegabook
Personally never did R studio. Unfiltered command line is always more
flexible, and prevents inertial lockin to a specific tool, OS, to a large
extent. Now I'm supposed to do R in ultra-bloated Visual Studio?? I learned R
precisely to get away from the inefficiency of the (in the past 20 years,
functionally unchanged, visual-candy-only) Excel. How am I to be excited about
adding this thick, lumpy MS gravy, to my pure R experience? So that when I do
R on Linux or remotely I'm screwed? No thanks.

Addendum: Clearly the hive mind MS corporate drones are out in force
today/tonight. I know everybody is enamoured with MS-Eclipse etc but R is best
used unfiltered. Not hijacked into the laughable world of Windows and Visual
Studio. I know from bitter experience that the Windows versions of R are
terribly unstable by comparison with the Linux builds. I learned the latter
precisely for that reason. MS is playing a fantastic marketing game but I was
agnostic on platform until R on Windows started showing its catastrophic
limitations. It's a second class citizen as soon as you venture beyond the
basics. Take it from an ex R-on-Windows guy who uses R 10 hours per day.

~~~
phillc73
> R is best used unfiltered

Actually, no it's not.

One of R's strengths is its ability to manipulate data and then visualise the
output. Doing this via the command line is slow and cumbersome. Do you plan to
output a chart, save it, then open it with another application?

RStudio excels in not just being an IDE, but also a visual data representation
tool. Write the R code, view the chart in the same application (Rstudio),
tweak until happy, then save. It's a much smoother iterative process.

I'd be prepared to believe that perhaps a command line champion could manage
libraries and develop code direct from the R interpreter, as well as I can
using RStudio. However, I can't see how one could possibly produce the same
quality data visualisation working directly at the command prompt.

I don't know about Visual Studio, I don't use it, but your criticism of
RStudio is wide of the mark.

~~~
vegabook
Oh please. I do that 20x a day without R Studio. Saving a chart is as simple
as png(...). You are clearly too mouse-bound. I reject your comment out of
hand.

~~~
bhandziuk
Why save it at all when in RStudio you can skip that step. Doesn't have
anything to do with a mouse either because you still write and execute all the
code with the keyboard. This all seems very out of left field.

~~~
nicercat
but you don't have to save it to view it under the command line.

    
    
      > plot(rnorm(100))
    

is not going to give you anything different under R-Studio, than command-line
R, other than redirecting the identical output into a convenience window in
its IDE. Sure R-Studio will save a history for you and throw a few
conveniences at you but, command-line >plot(rnorm(100)) will popup a window on
all OS versions of R and you'll be able to visualize all day long. Including
multiple open charts. With selectable focus for further manipulation. R-Studio
(MS-VS-RStudio) is just a very thin wrapper on something which is 100% there
already. However, in return for nominal initial friendliness, it has the
downside of sleepwalking you into a workflow which, if you don't understand
what's going on underneath, will hold back your R learning curve.

Now IDEs are useful, if you understand the tradeoffs. They're a higher-level
wrapper on stuff, with all the pluses and minuses that that entails. Higher-
level = lower learning curve, greater immediate productivity, vs lower-level =
higher learning curve, lower immediate productivity but greater long term
power.

------
cbo8of
No love for C11?

