Over the last couple of days I updated my R and RStudio, now running the RStudio version: 2025.05.0+496 on a M1 Mac with Sequoia 15.4.1 .
However, everytime I want to index a variable from a dataframe, just to be simply printed in the console, the autocomplete staggers and does not want me to press enter at all. Removing characters using backspace also sometimes jumps 1 or 2 characters at the same time.
So if: aa <- data.frame(firstvariable = c(1:5), secondvariable = c(5:1))
just typing: aa$ in the console would pop up the autocomplete window with the variable names. I can there select the variable by using arrows and press enter succesfully.
However, typing the first few letters: aa$fir would not reduce the number of variables (in larger dataframes) or autocomplete or have me change the selection by using arrows, or even press enter....
Not a solution but a comment: it seems to be specific either to your operating system or your particular installation. I'm running the same version of RStudio on Linux Mint 22.1. With your example, if I type aa$ I get the autocomplete popup with two options, but if I type aa$f or aa$fir I get the autocomplete popup with just the single matching option.
Thanks @prubin for checking this out on your system. That is exactly how it used to work before updating to the newer RStudio on my system. Unfortunately I don't know which version the previous was, so I can't rollback at the moment.
This is very much a long-shot, but you could try resetting RStudio's state. I don't know what in the state info would account for the behavior you are seeing, but maybe there's some obscure setting stashed in there.
Thanks @prubin for pointing that out. Unfortunately, it did not help. I tried some commands after,
aa <- data.frame(first = rnorm(100), second = rnorm(100), third = rnorm(100))
Then: aa%f gives the autocomplete pop-up and I can either press enter or continue with entering the word first.
When I do this on my 'true' dataset ( let's call it df1 that I am working on (> 500 variables, >1000 rows), it becomes 'laggy' again and freezes. Doing a head(df1 makes it easier again to get the pop-up without freezing or lagginess of RStudio and I can continue using the autocomplete.
So, it seems like it is project-specific or even dataframe specific? Did the newer RStudio become more RAM heavy?
Does executing names(df1) get rid of the lag? It sounds like maybe a caching issue to me. If so, I don't see anything you can do about it (other than working with smaller databases ).
Unfortunately and indeed, @prubin it does seem to be an issue related to the size of the dataframe. The names(df) does not solve anything. Making a subset of rows of the dataframe (so, maintaining all the variables) makes the autocomplete work again (like in smaller datasets).
But, these large dataframes used to work perfectly fine! I tried rolling back to Rstudio 2024.x did not work, while I am quite sure that it did under these versions....
Update: strangely enough, even much smaller dataframes, but in a different project, also seem to be getting errors. All my above testing was done in a completely empty projects...
The failure of an RStudio rollback to fix it suggests that R 4.5.0 may be implicated (along with RStudio, your hardware and operating system, and the alignment of certain celestial bodies).
Does this happen with files that are not part of a project?
@prubin, yet it does, I tried loading the RDS with the large dataframe without opening a specific project with an empty environment, still the same problem occurs, smaller datasets work fine indexing these in the autocomplete pop-up while typing.....