IDEs for R

Friendly UIs for the almost-friendly statistical programming language



There are many IDEs that you can use to interface with R; I use most of them. Which one is determined by a combination of momentum and the details of the current project. They are all annoying in different ways, and of course, switching between them is annoying in its own special way.

RStudio

Unfortunate terminology note: RStudio.com, the company behind the software, has done lots of amazing things, and produced some really good software and services that I am happy to use. It will become clear that their eponymous flagship product, RStudio, is my least favourite amongst their offerings. This will be slightly confusing in what follows, but I hope it is clear that I mean the IDE in particular.

RStudio by RStudio is the most famed IDE for R. It happens to include a passable text editor, and some genuinely neat features (Equation preview! Blog autogeneration! Data explorer! Interactive widgets! Deep integration of libraries! etc!) and some misfeatures (bizarre and idiosyncratic keyboard shortcuts, emoji support is glitchy, bad integration for non-R languages…). Overall I find RStudio helpful for generating graphs and reports and slides, but I edit non-trivial code in VS code, because that way I do not constantly need to break my flow to work around a missing RStudio affordance. If I attempt to work solely in RStudio, I find it intolerably annoying because just when something neat (say, the integrated plotting) has saved me some time, I then reach for a non-R-specific standard feature (multi-file search and replace, say) which every other code editor does well, and I am instantly vexed because it is broken in RStudio, or missing entirely. In my practice, RStudio fills the role of graphing package with neat macros which presents as an editor. IfI attempt to keep healthy boundaries around my RStudio usage and in particular try to avoid accidentally falling into the trap of expecting it to be a good tool for managing large amounts of code. This switching also leads to some frictions, but at least they are predictable ones that I understand pretty well, and thus easier to manage.

Why is RStudio?

I do not understand the business model for the software decisions here, of trying to make RStudio-the-IDE into a one-stop R monolith. They have developed many amazing features for an IDE that could have been grafted on to an existing IDE to enhance the R experience. But that is not what they did. Instead, they built a whole new IDE from the ground up with those features. Now they need to build all the other features that all the other IDEs have. This made the job harder, and also annoys people who have opinionated attachment to the many highly refined features of modern IDEs or code editors. Maybe there is some licensing restriction that forces this? They do sell licenses to a commercial version of the software, which is understandable. Or possibly this is a decision they would have made differently if the many open code editors out there had existed when they started the project.

On the other hand they do appear to be doubling down on RStudio as a general purpose IDE so perhaps there is something else entirely going on there.

R user attempting to invoke desired R function; Note unmatched parentheses.

Remote RStudio

One value-add for RStudio is that the IDE can be served as a remotely-deployed web-app which you can access through the browser. OTOH, so can VS Code or the Jetbrains IDEs to an extent, so this selling point is not unique.

Anyway, see the following blogpost for a taste of Rstudio Server: RStudio 1.4 Preview: New Features in RStudio Server Pro

Debugging in RStudio

One convenience is that the debugger is well integrated. Moreover, it is a graphical interactive optionally-web-based debugger and if it had any more buzzwords in it would socially tag your instagram and upload in to the NSA’s Internet Of Things to be 3D printed. Might be worth trying.

Extensions

There is an rstudio add-in addinslist which finds nifty/hip extensions:

install.packages('addinslist')

Jamovi

Also noted under spreadsheet interfaces,

Jamovi is a new “3rd generation” statistical spreadsheet. Designed from the ground up to be easy to use, jamovi is a compelling alternative to costly statistical products such as SPSS and SAS.

jamovi is built on top of the R statistical language, giving you access to the best the statistics community has to offer. would you like the R code for your analyses? jamovi can provide that too.

The interface looks good. It is lacking certain features that I would regard as moden (generalized linear models, AFAICT interaction terms in regressions) but it does good classical testing and analysis, and nudges you towards best practice especially in hypothesis tests.

It seems that one can develop extra extensions, so really I should shut up and implement my favourite modern models if I think that is worth doing.

VS Code for R

vscode-R provides R session support from inside VS Code. In some locations this is referred to as Ikuyadeu.r? AFAICT this is a process of renaming in-progress, but they are the same.

There is also deep integration of language internals (autocomplete etc) via R-languageserver client (which will eventually get merged into vscode-R apparently.) R needs the language server installed.

install.packages("languageserver")

The corresponding extension is

ext install REditorSupport.r-lsp

Debugger support: vscDebugger

install.packages(c('R6', 'jsonlite'))
# presumably also
install.packages('vscDebugger')

These options are rough, but serviceable.

Radian

radian is an alternative console for the R program with multiline editing and rich syntax highlight. One would consider radian as a ipython clone for R, though its design is more aligned to julia.

It is in fact a python app, so of course it comes with python isntallation annoyances. One trick to install it locally alongside an renv is to use, for example, conda

conda create --channel=conda-forge  --prefix=./pyenv radian

or praps pipx to install it globally, I suppose:

pipx install radian

The feature list is both enticing and an essay in how the actual R shell is not that great actually.

  • shell mode: hit ; to enter and <backspace> to leave
  • reticulate python repl mode: hit ~ to enter
  • improved R prompt and reticulate python prompt
    • multiline editing
    • syntax highlight
    • auto completion (reticulate autocompletion depends on jedi)
  • unicode support
  • latex completion
  • auto matching parens/quotes.
  • bracketed paste mode
  • emacs/vi editing mode
  • automatically adjust to terminal width
  • read more than 4096 bytes per line

Exploratory

Exploratory is an exploratory data analysis workbench built in R with lots of nice tools and things. At USD49/month for entry level access the price curve is too steep for me, so I have not tried it.

Inzight

iNZight for Data Analysis

iNZight now extends to multivariable graphics, time series, and generalised linear modelling (including modelling of data from complex surveys).


No comments yet. Why not leave one?

GitHub-flavored Markdown & a sane subset of HTML is supported.