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

1 Like

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().

1 Like

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.

1 Like

None of the above worked for me. As I explained, I recloned the project, create a new brand project for it and still got the issue. I have to accept that View() does not work for this project. It is really confusing and annoying.

On the other hand, tibble::view(df) works, so I am afraid I will always have to type that command for this project instead of clicking on the data frame objects on the RStudio "Environment"

Thanks for the comments and suggestions

1 Like

Strange. Sorry for where things are, hopefully the root cause will reveal itself one day.

Same Problem here but for Tibbles. I can't view a pretty small tibble. R Studio remains idle and can't run any more code. I need to restart the entire session or force quit.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.