R session aborted when loading 'raster', 'terra'

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

R Session Startup Failure Report

RStudio Version

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

Error message

[No error available]

Process Output

The R session exited with code 1.

Error output:

[No errors emitted]

Standard output:

[No output emitted]

Logs

C:/Users/xxxxx/AppData/Local/RStudio/log/rsession-xxxxx.log

) [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

Is this installed. Try

library(raster)

Yes, I installed the "raster". I think this error report came out when I just uninstalled the raster package. Now I have it, but R/Rstudio keeps crashing and no longer generates any error report.

OK, edit your question accordingly and maybe some Windows person can help.

Thanks. I deleted all previous versions of R and downloaded it again. I reinstalled every single package and the problem got solved!

1 Like

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.