RStudio – Markdown Crash: Error in (function (srcref) : unimplemented type (29) in ‘eval’


My RStudio crashed a number of times with the following error:

Error in (function (srcref) : unimplemented type (29) in 'eval'

The similarities where this has happened were:

  • I was working in a Markdown Notebook
  • I believe it was always when I selected the "Run all chunks above" command
  • I had run some code chunks in the current session before (so it wasn't upon starting work)

The error was always displayed just before the RStudio session aborted. I lose all my data and variables in the environment, but most of the code seems to be recoverable.

Anyone with an idea of what might cause this or how to deal with it?

Here my SessionInfo

R version 4.0.0 (2020-04-24)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18363)

Matrix products: default

[1] LC_COLLATE=English_United Kingdom.1252  LC_CTYPE=English_United Kingdom.1252    LC_MONETARY=English_United Kingdom.1252
[4] LC_NUMERIC=C                            LC_TIME=English_United Kingdom.1252    

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

other attached packages:
 [1] data.table_1.12.8 forcats_0.5.0     stringr_1.4.0     dplyr_0.8.5       purrr_0.3.4       readr_1.3.1      
 [7] tidyr_1.0.2       tibble_3.0.0      ggplot2_3.3.0     tidyverse_1.3.0  

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.4.6     cellranger_1.1.0 pillar_1.4.3     compiler_4.0.0   dbplyr_1.4.3     tools_4.0.0      packrat_0.5.0   
 [8] lubridate_1.7.8  jsonlite_1.6.1   lifecycle_0.2.0  nlme_3.1-147     gtable_0.3.0     lattice_0.20-41  pkgconfig_2.0.3 
[15] rlang_0.4.5      reprex_0.3.0     cli_2.0.2        DBI_1.1.0        rstudioapi_0.11  haven_2.2.0      xfun_0.13       
[22] withr_2.2.0      xml2_1.3.1       httr_1.4.1       knitr_1.28       fs_1.4.1         hms_0.5.3        generics_0.0.2  
[29] vctrs_0.2.4      grid_4.0.0       tidyselect_1.0.0 glue_1.4.0       R6_2.4.1         fansi_0.4.1      readxl_1.3.1    
[36] modelr_0.1.6     magrittr_1.5     backports_1.1.6  scales_1.1.0     ellipsis_0.3.0   rvest_0.3.5      assertthat_0.2.1
[43] colorspace_1.4-1 stringi_1.4.6    munsell_0.5.0    broom_0.5.6      crayon_1.3.4    

I sadly can't give you a reproducible example, but this is a screenshot of the last time it happened:
enter image description here

And the next time following a fairly simple ggplot command:
enter image description here

Best Answer

You might try updating Rstudio.

I had similar messages that started to occur after I updated to version 4.0.0 of R. These errors were occurring with code that presented no problems on previous versions of R. I could run the code line by line with Ctrl-Enter with no error, but running the whole chunk would be a problem.

The issue went away when I updated Rstudio from Version 1.1.463 to 1.2.5042.