Dealing with RStudio Aborting

Hi everyone,

My first post here, but I'm hoping someone can help.

I've been using RStudio for around 3 months now.

One problem I have on my current dataset is R constantly aborting when I use the bas.lm function from the BAS package. It keeps telling me R has encountered a Fatal Error and needs to restart.

I know this is rather vague, but can anyone point me in the right direction of how to debug this? It's really becoming a problem. Is there a log file I can find and use? Or any common tips here? Any help would be really useful.

Hi, welcome!

Can you reproduce this issue with a smaller subset of your dataframe? If not, then very likely you are just running out of RAM memory when processing your data with bas.lm().

1 Like

Thanks the for welcome.

You could be right actually, it only sometimes crashes.

Another dumb, newbie, question, is there any simple way to free up RAM memory within RStudio? I suspect I've got a lot of things loaded here.

You can remove all the objects in your gobal environment by pressing this button

Also, you can unload all non base libraries that you have loaded by restarting your R session

image

If you want ot be more selective you can use somethin like this

rm("object_name") # Remove one specifyc object or a list
detach("package:dplyr", unload = TRUE) # Unload a specifyc library
1 Like

Hey thanks for this.

Turned out I hadn't cleared out the global environment since I began using R.

Hasn't crashed once since. thanks!

1 Like

Pro-tip re. clean environments (from R for Data Science) :wink:


1 Like

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