/r4intellij

An integration of the R programming language into Intellij IDEA

Primary LanguageJava

r4intellij

This project provides an integration of R, which is a language for statistical computing and graphics, into Intellij IDEA. It aims to bring the best language for data mining and modeling in touch with the best IDE ever.

By implementing a parser for R, the plugin allows for syntax highlighting, intelligent code folding and completion, refactorings, and more.

Installation

  1. Get Intellij IDEA, which is available as pro and and as free open-source community edition from JetBrains.
  2. To install the plugin, just open the plugin manager in Intellij Idea, search for "R4Intellij" , and finally click install.

Support

Feel welcome to ask questions in the plugins discussion forum of Intellij. Don't forget to tag your posts with the tag r4intellij (otherwise we might not read it).

Before you asked questions, you should consider to read our FAQ.

Basic Usage

Just drag an R-file into idea and start hacking.

You can also create a new project (the type does not matter) and organize your work into modules with different content roots. Read the Intellij documentation for more details about to do this.

File extensions

By default R4Intellij supports these file extensions: .R IntelliJ offers the possibility to link so far unknown file extensions to a plugin. Just choose R4Intellij to open files with this newly registered file extension as R files.

Source code navigation

The following features are supported

  • Go To --> Declaration (of symbols and locally defined functions)* View --> Quick Definition Lookup (of functions): This will show the signature and a short description

  • Search --> Highlight Usage: This will make Intellij to highlight all locations where a function or a symbol is being used* Brace matching: If you position the caret before or after a bracket then IntelliJ will highlight the other element of the pair of brackets.* File Structure View: In the structure view IntelliJ shows the functions and code sections of the R script.

Most of these functions use the default shortcuts of the Intellij platform. Custom shortcuts can be inferred from the menu entries.

Integration with R session

R4Intellij supports the evaluation of the current selection or line on Windows (RGui) and MacOS (R GUI, Terminal, iTerm2). Furthermore, the user can define up to 4 custom code action which allow to wrap the current selection into some function before sending it to R. For instance, a custom head of a data.frame action would be defined as head(%snippet%);. These custom code actions can be defined in the preferences and can get keyboard shortcuts assigned to them.

Code completion

R4Intellij builds an index of your local R installation which allows for much better completion, local error highlighting, integrated documentation lookup and more.

To build the index of all packages installed in your R instance, R4Intellij needs . On most platforms it will guess it correctly, but you can adjust it if necessary in the preferences.

The following completion modes are available:

  • Basic word completion for variables and local functions* Coming soon: Package name completion in library statements* Coming soon: setwd() aware path completion* Coming soon: completion of package names in library statements

Refactoring

All refactorings can be accessed via the "Refactor" menu

  • Renaming of symbols and functions

Intentions

Intentions are on-the-fly checks of your R scripts, that highlight problems and (optionally) suggest automatic quick fixes

  • Auto-import of packages given a function name

Planned & Coming soon

  • Source code formatting* Code transformation fixes (like: Convert qplot to ggplot call)* More refactorings (Extract function; Extract variable)* More context-aware autocompletion for variables, functions and file paths* Inspections and quickfixes for common problems

Feel welcome to suggest new features by adding a ticket to our tracker!

Platform features

The main strength of our plugin is the underlying Intellij IDE. So if you have not worked with it before, read more about all its amazing features. It ships with everything from SCM integration (Git, Subversion, etc.), neat SQL integration, bash scripting support, and so many more interesting features. However, it's main "feature" is its usability. Give it a try!

You're still not convinced? Try something else!

Give a try to StatET, textmate (with the rbundle), or http://rstudio.org/ RStudio.

Feel welcome to report problems or suggest new features by adding an issue to our tracker.

Other projects of the author

  • Movito - An awesome movie collection manager for files, BlueRays and DVDs. It supports movies and TV-series and provides a slick interface to explore and filter your movie collection
  • OpenCards - A free flashcard learning software for ppt-files