View() does not work on RStudio

View(data.frame) does not work on my Mac OS X 11.6 and the latest version of RStudio (2021.09.0+351 "Ghost Orchid" Release (077589bcad3467ae79f318afe8641a1899a51606, 2021-09-20) for macOS

But the incredible thing (and it's driving me crazy) is that it does not work for only ONE Rproj. I have tried to delete the Rproj file and create the project again... it didn't work; delete all source code, re-clone the repo, create a new Rproject for the new downloaded repo... and View() still does not work.

Again, it is working as usual for any other Rproj, but not for this particular one. Everything else seems to be working fine. It fails only when I try to visualize a data frame. For example, given any data frame object (df), when clicking on the object in the "Environment" tap... Rstudio freezes. If I type View(df)... it freezes, and if I type utils::View(df)

Any help would be greatly appreciated

Have you loaded the tidyverse library?

Spellling, it is view not View


works for me.

I guess there is the base::View() and the tibble::view().

I forgot it even existed assuming I ever knew about it.

If you open the .Rproj file with a text editor, do you have any setting in there that's different from your other working projects?

Yes, I was referring to the utils::View() function, that I think it is the one that Rstudio uses by default when clicking to the objects in the "Environment" panel.

With respect to @jrkrideau question, here is the .Rproj

Version: 1.0

RestoreWorkspace: Default
SaveWorkspace: Default
AlwaysSaveHistory: Default

EnableCodeIndexing: Yes
UseSpacesForTab: Yes
NumSpacesForTab: 2
Encoding: UTF-8

RnwWeave: Sweave
LaTeX: pdfLaTeX

BuildType: Package
PackageUseDevtools: Yes
PackageInstallArgs: --no-multiarch --with-keep.source
PackageRoxygenize: rd,collate,namespace,vignette

which is exactly the same as other .Rproj file that I have for another package that I developed.

It's truly annoying. Any ideas on what could be happening?

Thank you very much!

This suggests that you probably allow your global workspace to persist from one R session to the next, in this project. And that is a good bet for where the inexplicable fatal weirdness lies.

I can't guarantee it will solve your particular problem, but cleaning out the global workspace would be worth trying. And adopting as a lifestyle.

This slide shows how to change your RStudio global settings to live this way, i.e. never allow the global workspace to "leak" from one R session and the next:

usethis::use_blank_slate() will also do this setup for you.