How to totally reset RStudio and point to new R

Until today I thought I was on R 4.4.0 and the latest RStudio (2024.04.1+748)
I still had R 4.3.2 installed
OS is Windows 10

Today RStudio just hung on startup with 2 Windows open - a standard RStudio window with blanked menu items and an R icon. Something like 6 tasks are running
I tried to stop them and restart but same again. Several repeats
I ran the diagnostic and got some output
I tried the reset by renaming Rstudio folder in AppData

I have since removed all version of R and reinstalled RStudio but I get an error message saying R does not appear to be installed

How can I start again please?

Update: I have a found a log which says "2024-05-22T09:54:57.189Z ERROR ERR_FAILED (-2) loading 'file://C:\Program Files\RStudio\resources\app.webpack\renderer\choose_r\index.html"

I suggest that you begin by running R from a command prompt to make sure it is properly installed. Assuming that R works, you might try resetting RStudio's state as described here.

1 Like

Thank you
yes - R itself works
And I tried renaming both the folders referenced in the reset article
As well as box saying R does not appear to be installed I the following message in C:\Users\XX\AppData\Local\RStudio:

2024-05-22T15:15:42.755Z ERROR ERR_FAILED (-2) loading 'file://C:\Program Files\RStudio\resources\app\.webpack\renderer\choose_r\index.html'

It looks like the startup tries to run the R pick dialogue but that is failing.
It looks like "file not found" and yet that html is there

I have also checked that the R install updated the Windows Registry
I wondered if there was a detailed Posit RStudio detailed debugging guide?
I have been running RStudio for a few years on this machine without issue - and I also notice that if I try to run RStudio for the first time on a new user on the PC, I get the same message

On Windows, you can also press "ctrl" during RStudio startup to manually point to R.

There's a support page that discusses startup problems at https://support.posit.co/hc/en-us/articles/200488508-RStudio-Desktop-IDE-Will-Not-Start, as well as an old bug report (which I think was supposedly resolved) at RStudio not able to load selected R version on Windows · Issue #12452 · rstudio/rstudio · GitHub that contains some things you might try.

1 Like

Thank you.
I did that. I think it tries to initiates the same choose_r html as I mentioned above
I am getting a new error message in the log "2024-05-22T15:47:29.738Z ERROR Render frame was disposed before WebFrameMain could be accessed"

1 Like

All fixed.
One of the articles (RStudio not able to load selected R version on Windows · Issue #12452 · rstudio/rstudio · GitHub) refers to a debug log mode
That was showing 2 R instalaltions in the Windows Registry - even though there was only one
I deleted that, rebooted and all good

The key was running this script to highlighted the bogus installation in the registry

C:\Program Files\R\R-4.4.0\bin\x64\R.exe

cd %LOCALAPPDATA%\RStudio\log
del rdesktop.log

cd "C:\Program Files\RStudio"
set RS_LOG_LEVEL=debug
set RSTUDIO_DESKTOP_PROMPT_FOR_R=1
rstudio.exe
2 Likes

This topic was automatically closed 90 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.