RStudio crashes after few minutes

Crash Information:

Description of crash -
When I open RStudio and start writing simple code, the application only lasts a few minutes before it freezes and then shows a dark, gray screen. I've tried uninstalling/reinstalling both R and RStudio but nothing has worked.

Steps to reproduce -

System Information:

  • RStudio Edition:
  • RStudio Version: 1.2.5033 (for Mac)
  • OS Version: mac0S Mojave 10.14.6
  • R Version: 3.6.2
  • Your sessionInfo():

R version 3.6.2 (2019-12-12)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS Mojave 10.14.6

Matrix products: default
BLAS: /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRblas.0.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats graphics grDevices utils datasets methods base

loaded via a namespace (and not attached):
[1] Rcpp_1.0.3 plyr_1.8.4 pillar_1.4.2
[4] compiler_3.6.2 gower_0.2.1 class_7.3-15
[7] iterators_1.0.12 tools_3.6.2 rpart_4.1-15
[10] ipred_0.9-9 nlme_3.1-142 gtable_0.3.0
[13] lubridate_1.7.4 tibble_2.1.3 lattice_0.20-38
[16] pkgconfig_2.0.3 rlang_0.4.1 Matrix_1.2-18
[19] foreach_1.4.7 prodlim_2018.04.18 withr_2.1.2
[22] dplyr_0.8.3 stringr_1.4.0 generics_0.0.2
[25] recipes_0.1.7 stats4_3.6.2 grid_3.6.2
[28] nnet_7.3-12 caret_6.0-84 tidyselect_0.2.5
[31] data.table_1.12.6 glue_1.3.1 R6_2.4.1
[34] survival_3.1-8 lava_1.6.6 kernlab_0.9-29
[37] reshape2_1.4.3 purrr_0.3.3 ggplot2_3.2.1
[40] magrittr_1.5 ModelMetrics_1.2.2 scales_1.0.0
[43] codetools_0.2-16 MASS_7.3-51.4 splines_3.6.2
[46] assertthat_0.2.1 colorspace_1.4-1 timeDate_3043.102
[49] stringi_1.4.3 lazyeval_0.2.2 munsell_0.5.0
[52] crayon_1.3.4


From Troubleshooting Guide: RStudio Crashed

Sorry to hear you're having trouble. Do you have any better luck if you switch to software rendering?