I updated RStudio to 2022.12.0, and my current R version is 4.2.2. However, after the update I failed to load packages like "raster", "terra", or "lidR"... An error message popped out saying R session aborted, but did not specify any reason. So I uninstalled R and RStudio, re-installed both of them, but this issue still exists. It only crashes when I load certain packages (e.g. raster). I uninstalled those fail-to-run packages and reinstalled them. The re-installation did not have any problem, but it crashed again when I tried to activate them [ for example: library("raster")]. I even tried using previous versions of R/RStudio, but it didn't help. I'm not sure how to solve this problem...
I've tried different solutions, but it crashed every single time, regardless of using R or RStudio. From hundreds of crashes, at one point it generated a report which I hope might be helpful...
RStudio 2022.12.0+353 "Elsbeth Geranium " (7d165dcf, 2022-12-03) for Windows
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) RStudio/2022.12.0+353 Chrome/102.0.5005.167 Electron/19.1.3 Safari/537.36
[No error available]
The R session exited with code 1.
[No errors emitted]
[No output emitted]
) [errormsg: Error in .requirePackage(package) : unable to find required package ‘raster’ ]; OCCURRED AT class rstudio::core::Error __cdecl rstudio::r::exec::`anonymous-namespace'::evaluateExpressionsUnsafe(struct SEXPREC *,struct SEXPREC *,struct SEXPREC **,class rstudio::r::sexp::Protect *,enum rstudio::r::exec::`anonymous-namespace'::EvalType) src/cpp/r/RExec.cpp:198; LOGGED FROM: class rstudio::core::json::Value __cdecl rstudio::session::modules::environment::varToJson(struct SEXPREC *,const struct std::pair<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,struct SEXPREC *> &) C:\Users\jenkins\workspace\ide\open-source-pipeline\elsbeth-geranium\src\cpp\session\modules\environment\EnvironmentUtils.cpp:223