RStudio no longer working after upgrade to R 4.2.0

I just upgraded R to 4.2 on my University's research cluster. The cluster runs Windows 10, fully updated. R4.2 and Rtools4.2 are installed, and I have recreated my private library by copying all files from the 4.1 sublibrary to a new 4.2 folder. I can open the new native R4.2 with no problem and seem to be able to run things there just fine. But RStudio is now not working. It immediately abends when I try to open it, without any helpful message.

When I upgraded R to 4.2 on my home computer, I had the same problem. I had to uninstall Rstudio and then reinstall it. It seemed that the version number of the newly downloaded RStudio was not the same as the one I was using before the upgrade.

So the bottom line is, do I have to get my sysop to upgrade RStudio for it to be able to work with R4.2?
Larry Hunsicker

About this part, have in mind that packages need to be recompiled after a major R version upgrade so do not forget to run update.packages(checkBuilt = TRUE)

Resetting RStudio's state might be enough to make it recognize the new R version but have in mind that R 4.2 uses a new rendering engine that is only supported on the latest RStudio version so it might be worthy to upgrade just to have full graphics compatibility

Ahhh! I missed the "checkBuilt = TRUE". I seem to have to tell R to update each package separately. Is there another bit of magic that would tell R "yes" for all of the packages?

If I'm understanding you correctly, the magic would be ask = FALSE

I'm making progress, I think. I have completed updating my library, and now there are only 9 packages that are not updated to 4.2: cairodevice, car, EasyABC, gdata, ggplot2, gWidfets2RGtk2, rethinking, RGtk2, and USABoundariesData .

The only one of these that I am concerned about is ggplot2. There is a version of ggplot2 in my private library, and it seems to install and function correctly at least for simple plots. This would seem to be a pretty important update, though. Any news about this?

More important, however, is that I am still unable to open the currently installed version of RStudio since updating the R to 4.2. When I try to open RStudio, it immediately crashes with the comment "RStudio Rsession has stopped working," and no other error code. But when I close the window, I get the following:

## R Session Startup Failure Report

### RStudio Version

RStudio 2021.09.0+351, "Ghost Orchid" (077589bc, 2021-09-20) for Windows

Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) QtWebEngine/5.12.8 Chrome/69.0.3497.128 Safari/537.36

### Error message

[No error available]

### Process Output

The R session exited with code 0. 

Error output:

[No errors emitted]


Standard output:

[No output emitted]


### Logs

*C:/Users/hunsickerl/AppData/Local/RStudio/log/rsession-hunsickerl.log*

2022-05-03T13:22:31.196606Z [rsession-hunsickerl] WARNING findProgramOnPath returns wrong result: C:\Users\HUNSIC~1\AppData\Roaming\TinyTeX\bin\win32\pdflatex.exe != C:/Users/hunsickerl/AppData/Roaming/TinyTeX/bin/win32/pdflatex.exe; LOGGED FROM: class rstudio::core::FilePath __cdecl rstudio::session::module_context::findProgram(const class std::basic_string<char,struct std::char_traits,class std::allocator > &) src/cpp/session/SessionModuleContext.cpp:1206
2022-05-03T13:22:31.217093Z [rsession-hunsickerl] WARNING findProgramOnPath returns wrong result: C:\Users\HUNSIC~1\AppData\Roaming\TinyTeX\bin\win32\pdflatex.exe != C:/Users/hunsickerl/AppData/Roaming/TinyTeX/bin/win32/pdflatex.exe; LOGGED FROM: class rstudio::core::FilePath __cdecl rstudio::session::module_context::findProgram(const class std::basic_string<char,struct std::char_traits,class std::allocator > &) src/cpp/session/SessionModuleContext.cpp:1206
2022-05-03T13:22:31.217093Z [rsession-hunsickerl] WARNING findProgramOnPath returns wrong result: C:\Users\HUNSIC~1\AppData\Roaming\TinyTeX\bin\win32\pdflatex.exe != C:/Users/hunsickerl/AppData/Roaming/TinyTeX/bin/win32/pdflatex.exe; LOGGED FROM: class rstudio::core::FilePath __cdecl rstudio::session::module_context::findProgram(const class std::basic_string<char,struct std::char_traits,class std::allocator > &) src/cpp/session/SessionModuleContext.cpp:1206

Evidently RStudio is not parsing the Windows file location correctly, since 
C:\Users\HUNSIC~1\AppData\Roaming\TinyTeX\bin\win32\pdflatex.exe  
expands to
C:/Users/hunsickerl/AppData/Roaming/TinyTeX/bin/win32/pdflatex.exe

Is this error something due to the difference between R3.1 and R3.2? 

When I removed RStudio and reinstalled it with a new version 2022.02.2 Build 485, one my home machine, RStudio then opened correctly with R 3.2.0.  

I guess that before I ask my sysop to update our copy of RStudio, I'd want to be sure that the new version will play nicely also with the R 3.1.x versions that other folks on the cluster are continuing to use.

Any suggestions?
Thanks for your help!
Larry

Even if the package runs I would recompile for the current version of R just to avoid possible sources of problems. There's nothing special about recompiling ggplot2 compared to all the other packages you have already recompiled.

This seems like a problem with your tinytex installation, I would complete remove tinytex, including the TinyTex LaTeX distribution (not referring to the R package) and then install again from R 4.2

install.packages('tinytex')
tinytex::install_tinytex()

The problem went away when my sysop updated RStudio to 2022.02.2 Build 485. I'm not sure whether it would have been fixed by reinstalling TinyTex, etc. Perhaps that was done with the update of RStudio. In any case, everything seems to be good now. There is still a handful of packages that are still not updated to Build 4.2.0. But the previous versions still seem to be working.
Thanks for all the help with this upgrade!
Larry