SachaEpskamp / qgraph

Developmental version of qgraph
GNU General Public License v2.0
68 stars 21 forks source link

R 4.2.2 Crashes when using qgraph on Windows 10x64 #71

Closed sareinhardt closed 1 year ago

sareinhardt commented 1 year ago

Hello, I am experiencing a weird error: R Studio crashes anytime I use qgraph. I am sorry for probably not giving the perfect bug report, while I do some social network analysis, I am generally not very code-savvy.

This is my session info

R version 4.2.2 (2022-10-31 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19045)

Matrix products: default

locale:
[1] LC_COLLATE=German_Germany.utf8  LC_CTYPE=German_Germany.utf8   
[3] LC_MONETARY=German_Germany.utf8 LC_NUMERIC=C                   
[5] LC_TIME=German_Germany.utf8    

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

other attached packages:
 [1] stringr_1.5.0        dplyr_1.1.0          qgraph_1.9.3        
 [4] geosphere_1.5-18     maps_3.4.1           circlize_0.4.15     
 [7] RColorBrewer_1.1-3   GGally_2.1.2         gridExtra_2.3       
[10] progress_1.2.2       ggrepel_0.9.3        ggplot2_3.4.1       
[13] vioplot_0.4.0        zoo_1.8-11           sm_2.2-5.7.1        
[16] scales_1.2.1         vegan_2.6-4          lattice_0.20-45     
[19] permute_0.9-7        igraph_1.4.0         sna_2.7-1           
[22] statnet.common_4.8.0 network_1.18.1      

loaded via a namespace (and not attached):
 [1] nlme_3.1-162        tools_4.2.2         backports_1.4.1    
 [4] utf8_1.2.3          R6_2.5.1            rpart_4.1.19       
 [7] Hmisc_4.8-0         mgcv_1.8-41         colorspace_2.0-3   
[10] nnet_7.3-18         withr_2.5.0         sp_1.6-0           
[13] mnormt_2.1.1        tidyselect_1.2.0    prettyunits_1.1.1  
[16] compiler_4.2.2      fdrtool_1.2.17      cli_3.5.0          
[19] htmlTable_2.4.1     checkmate_2.1.0     psych_2.2.9        
[22] quadprog_1.5-8      pbapply_1.7-0       pbivnorm_0.6.0     
[25] digest_0.6.31       foreign_0.8-84      rmarkdown_2.20     
[28] base64enc_0.1-3     jpeg_0.1-10         pkgconfig_2.0.3    
[31] htmltools_0.5.4     fastmap_1.1.0       htmlwidgets_1.6.1  
[34] rlang_1.0.6         GlobalOptions_0.1.2 rstudioapi_0.14    
[37] shape_1.4.6         generics_0.1.3      gtools_3.9.4       
[40] magrittr_2.0.3      Formula_1.2-5       interp_1.1-3       
[43] Matrix_1.5-3        Rcpp_1.0.10         munsell_0.5.0      
[46] fansi_1.0.4         abind_1.4-5         lifecycle_1.0.3    
[49] stringi_1.7.12      yaml_2.3.6          MASS_7.3-58.2      
[52] plyr_1.8.8          lavaan_0.6-14       parallel_4.2.2     
[55] crayon_1.5.2        deldir_1.0-6        splines_4.2.2      
[58] hms_1.1.2           knitr_1.42          pillar_1.8.1       
[61] corpcor_1.6.10      stats4_4.2.2        reshape2_1.4.4     
[64] glue_1.6.2          evaluate_0.20       latticeExtra_0.6-30
[67] data.table_1.14.8   png_0.1-8           vctrs_0.5.2        
[70] gtable_0.3.1        reshape_0.8.9       xfun_0.36          
[73] coda_0.19-4         glasso_1.11         survival_3.5-3     
[76] tibble_3.1.8        cluster_2.1.4       ellipsis_0.3.2 

It happens anytime I run this code, especially, I think it happens more often when I run the second layout (lm object).


l <- qgraph.layout.fruchtermanreingold(edges, weights=edges$weight,vcount=vcount(graph_deu))

lm <- qgraph.layout.fruchtermanreingold(edges,vcount=vcount(graph_deu), area=3*(vcount(graph_deu)^2),repulse.rad=(vcount(graph_deu)^3))

I'd love to add a reproducible example but I am not sure how to since my dataset is rather big and also I am not allowed to publish it - sorry, this probably does not help much, I don't know much about it but I will try to if you tell me what you'd need.

I tried some of the suggested solutions from this thread https://github.com/rstudio/rstudio/issues/9373 like x11() and switching to AGG, but I did not have success. I also tried doing it on another computer but it did not function on another device either.

I would really super appreciate any help regarding this issue, as I urgently need to finish some graphs for work. The same code ran fine for another project a month ago and I am a bit desperate.. Thanks a lot!

SachaEpskamp commented 1 year ago

Hi! It will be hard to answer this question without a reproducible example. But please note that qgraph.layout.fruchtermanreingold is not a user friendly function that is designed to be used manually. I cannot recommend using it and recommend you use qgraph(...,layout="spring") to also obtain the legend (possibly by setting the layout.par argument).