Dataframe in external (pop-out) Viewer is reloaded when using console, and filtering is lost

Greetings !

I use R-notebooks to help me clean datasets prior to database import. I usually have 1 or more data frames "open" (i.e. popped out and viewable in a separate window) while I go through my scripting template (which is an Rmd R-Notebook file).

The issue -- Currently, whenever I run a code-block (ctrl + shift + enter), the data frame in the pop-out window resets. This includes a resetting of any filters I had used in the data frame window.
Moreover, this occurs if I use the Console in any way (i.e. 2 + 2).
The effect also occurs if I run a portion of a code-block, or if I use the green "run" button.

Previously, something like this would occur ONLY IF I was re-writing to that popped out data frame, and I would get a pop-out warning, stating: "Data Tables warning: table id=rsGridData - Cannot reinitialize DataTable. For more information..."

Currently, I get this warning -multiple times- for even a simple line of code that does not write to the DF, e.g.:

EDD02 %>% 
  {addmargins(table(.$PROJ_status, .$MPK_match, useNA="ifany", deparse.level = 2))}

What I expected -- I had assumed that when this occurred previously, it was because I was updating the data in the data frame, so the pop-out had to reset its view. However, I did not expect (nor had it happened previously, say before May 2024) that reading from the data frame or even typing in the Console would drive this behavior.

The current behavior is a bit of a problem, as I want/need to look at subsets of modestly-large data frames while I detect and correct particular types of errors in the sample data.

Question(s): Is there some way I can "fix" this or otherwise get back to the previous behavior? Are there other solutions to this issue? Does this occur for others ?

Environment info::
Win11, platform: x86_64-w64-mingw32
R version 4.4.1 "Race for Your Life"
Rstudio: desktop, version 2024.9.0.375, "Cranberry Hibiscus"

Using a CoPilot prompt, it was suggested to re-initialize the Rstudio profile (roughly: Username/AppData/Roaming/RStudio) as a way to fix the issue I described above.

This seems to have worked. Not sure why or what part of that folder was corrupted, but in case anyone else has similar issues I wanted to close the loop on this post.

Toby

This was apparently only a temporary solution. Upon further work, the problem came back.

Re-creating the Rstudio profile only worked for half a session before the behavior returned. Not sure how to continue.

Sorry you're having trouble -- could you please file this as a bug report at GitHub · Where software is built, so it doesn't get lost?

Thanks for the suggestion of reposting the bug to the github. I hope I submitted that report correctly.

Kind regards,
Toby

This issue appears to stem from recent changes in RStudio's handling of data frames in pop-out windows, likely due to updates in RStudio or the DT package. Here are some suggestions to mitigate the problem:

  1. Switch to Viewer Pane: Instead of popping out data frames, use the Viewer pane or the built-in "View()" function. This avoids the instability of external windows.
  2. Disable DT Updates: If you are using the DT package for viewing data, set DT::datatable(options = list(stateSave = TRUE)) to persist filters and settings.
  3. Check for Package/Software Updates: Ensure you’re running the latest versions of RStudio and associated R packages. There might be bug fixes addressing this behavior.
  4. Downgrade RStudio: If this issue is critical, consider rolling back to a previous version of RStudio (prior to the problematic behavior, likely before May 2024).