R studio List and Dataframes auto name completion

2019-05-09 04:16发布

问题:

Suddenly R Studio stopped auto completing my list and data frame contents when entering mylist$ then pressing Tab. The result message I get is

No matches

I tried that on very simple lists or data frames like:

 simpledataset <- data.frame(a=rep(0,100),b=rep(1,100))   

However, when I load the dataset Mtcars, it correctly shows the column names.

I reset %localappdata%\RStudio-Desktop by renaming it, but didn't change anything.

Any idea of what could be the cause of that?

回答1:

This sounds like a bug in the autocompletion system that is occasionally triggered when certain packages are loaded, or the byte-compiler optimization setting is increased. You might try checking a few things:

  • What is the value of compiler::getCompilerOption("optimize")? Autocompletion is known to fail when this value is equal to 3 in the current RStudio release (v0.99.896). You can try running compiler::setCompilerOptions(optimize = 2) to resolve this.

  • What packages do you have loaded? You can try loading packages one-by-one to see which affects RStudio's ability to provide autocompletions.

Finally, there should be a fix for this in the preview version of RStudio -- you can try it out at https://www.rstudio.com/products/rstudio/download/preview/.



回答2:

Go to Tools>Global Options... and set autocomplete there.



标签: r rstudio