Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to get code completion for R in Emacs ESS similar to what is available in Rstudio?

Rstudio has a great code completion feature. It provides a quick view of functions that start with a given string, as well as function and parameter definitions.

ESS is powerful enough, familiar to me, and integrated into Emacs, where I conduct most of my work - so I am hesitant to move, but this feature is making me consider such a move.

Is it possible to integrate this feature into Emacs ESS?

Is there anything similar to this for Emacs ESS?

Any hope that there will be (and if so, how could I support such an effort?)

enter image description here

like image 622
Abe Avatar asked Jul 28 '11 20:07

Abe


People also ask

How do I use autocomplete in emacs?

Basic Field and Identifier AccessThe key to triggering the auto-completion in emacs is the Tab key. You will get a list of suggestions from the compiler. To select something from the list of suggestions, we recommend you to use C-n and C-p, but the down and up arrow keys can be used as well.

How do I use R in emacs?

Start up Emacs without a file argument - just type emacs & at the prompt. Now execute R-mode - enter M-x R Think of M-x as `execute' and `R' for R. Emacs will then ask you for your R Starting Directory - enter the directory where you want to create a new (or open an already existing one) .


1 Answers

You do get the completion thanks to the rcompgen package by Deepayan (now "promoted" into base R as part of the utils package). So when I type

lm( 

and hit TAB a new buffer opens which gets me the left-hand side of your window above: the available options to the function at hand. I don't think you can show the help directly though.

There is / was also a way to get context-sensitive help in the mini-buffer when typing but I have forgottten how/where that gets turned on.

like image 60
Dirk Eddelbuettel Avatar answered Sep 26 '22 12:09

Dirk Eddelbuettel