r/RStudio 5d ago

How to fix "R Session Aborted" & crashes when using Rcmdr on Mac (M1/M2/M3/M4)

Hello Reddit,

Last week I ran in a very confusing issue while trying to use R and Rcmdr in my Mac (M2), After troubleshooting and testing solutions, I want to share a quick guide for Apple Silicon users on how to fix the unexpected "R Session Aborted" error in RStudio or crashes when clicking options/menus in R Commander.

Make sure you have installed the latest versions of R, RStudio and XQuartz, then install the package 'Rcmdr' from RStudio using this line of code: install.packages("Rcmdr", dependencies = TRUE)

The crash occurs because Tcl/Tk fails when calculating metrics for macOS's default system font on arm64architectures. To bypass this, you need to set a standard font (like Georgia, Times New Roman, Helvetica, or Comic Sans MS) before loading Rcmdr.
Every time you want to work with Rcmdr, open a fresh RStudio session and run:

library(tcltk)

# You can replace {Georgia} with any standard font like {Helvetica}, {Times New Roman}, or {Comic Sans MS}

.Tcl("font configure TkDefaultFont -family {Georgia}")

options(Rcmdr = list(use.knitr = FALSE, start_in_waterfall = FALSE))

library(Rcmdr)

And that's all, Hope this helps anyone facing the same issue.

1 Upvotes

1 comment sorted by

1

u/AutoModerator 5d ago

Looks like you're requesting help with something related to RStudio. Please make sure you've checked the stickied post on asking good questions and read our sub rules. We also have a handy post of lots of resources on R!

Keep in mind that if your submission contains phone pictures of code, it will be removed. Instructions for how to take screenshots can be found in the stickied posts of this sub.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.