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

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


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.


[EDIT: This is an old answer and auto-complete package dropped out of fashion since then. Please use company-mode instead. It should work by default. Wiki configuration entry is here.]

Recent versions of ESS (> v.12.02) integrate with auto-complete package out of the box (you need not configure anything, just install auto-complete). It provides help on arguments as well as function help. I added detailed instructions to the wiki

Ess-ac screenshot

enter image description here

Ess-eldoc was also rewritten and from v.12.02 it's active by default, so you don't need to configure anything.


Or maybe we should all use search:

Emacs autocomplete-mode extension for ESS and R

I don't want to be grumpy, I found this few hours ago and I'm still shocked. It works like a charm. Though I still prefer the old-style pop-ups. =)