I'm trying to run topic models in R and calculate the best number of topics using the FindTopicsNumber function from the ldatuning package. If I run the following code on a macbook pro it fits the models but once it starts to calculate the first metric I get a fatal error and the R session is terminated. The code runs on a windows machine without problems. Does anyone know why it might not run on mac?
sessionInfo() output:
R version 4.0.5 (2021-03-31)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Catalina 10.15.7
Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.0/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.5.4 rstudioapi_0.13 xml2_1.3.2 magrittr_2.0.1 tidyselect_1.1.0
[6] munsell_0.5.0 colorspace_2.0-0 tm_0.7-8 R6_2.5.0 rlang_0.4.8
[11] dplyr_1.0.2 tools_4.0.5 parallel_4.0.5 grid_4.0.5 gtable_0.3.0
[16] modeltools_0.2-23 ellipsis_0.3.1 tibble_3.0.4 lifecycle_0.2.0 crayon_1.3.4
[21] NLP_0.2-1 purrr_0.3.4 ggplot2_3.3.2 vctrs_0.3.5 glue_1.4.2
[26] slam_0.1-47 compiler_4.0.5 pillar_1.4.7 topicmodels_0.2-12 generics_0.1.0
[31] scales_1.1.1 stats4_4.0.5 pkgconfig_2.0.3 ldatuning_1.0.2
The error producing mac:
MacBook Pro 13-inch late 2013
macOS Catalina 10.15.7
(tried with R 4.0.3 and 4.0.5)
The working windows machine:
Dell XPS 15 9550
Windows 10.0.14393
(tried with R 4.0.4 and 4.0.5)
library(topicmodels)
data("AssociatedPress")
owl <- ldatuning::FindTopicsNumber(AssociatedPress, topics = c(1:10),
metrics = c("Griffiths2004", "CaoJuan2009",
"Arun2010", "Deveaud2014"),
method = "Gibbs", control = list(seed = 1234),
mc.cores = parallel::detectCores() - 1,
verbose = T)
Based on this github issue, and the observation that only the griffiths metric causes the failure, the problem appears to be caused by the Rmpfr package. Reinstalling the package (i.e. install.packages("Rmpfr"); library(Rmpfr)) and/or building the package from source may solve the issue. For detailed instruction on compiling R packages from source see https://stackoverflow.com/a/65334247/12957340
Edit
I was able to install and run the command above using the following steps:
Install required dependancies using homebrew:
brew install gsl
brew install gmp
brew install mpfr
Edit .R/Makevars file to include these lines (after following instructions in https://stackoverflow.com/a/65334247/12957340):
FLIBS=-L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin19/10.2.0 -L/usr/local/gfortran/lib -lgfortran -lquadmath -lm
CXX1X=/usr/local/gfortran/bin/g++
CXX98=/usr/local/gfortran/bin/g++
CXX11=/usr/local/gfortran/bin/g++
CXX14=/usr/local/gfortran/bin/g++
CXX17=/usr/local/gfortran/bin/g++
CC=/usr/local/gfortran/bin/gcc
CXX=/usr/local/gfortran/bin/g++
PKG_LIBS=-L/usr/local/opt/gettext/lib
CFLAGS=-I/usr/local/opt/gsl/include -I/usr/local/opt/gmp/include -I/usr/local/opt/mpfr/include
LDFLAGS=-L/usr/local/opt/gsl/lib -L/usr/local/opt/gmp/lib -L/usr/local/opt/mpfr/lib -lgsl -lgslcblas
Install the required packages:
install.packages("topicmodels", type = "source")
install.packages("ldatuning", type = "source")
install.packages("Rmpfr")
And finally, run the example:
library(topicmodels)
library(ldatuning)
data("AssociatedPress")
owl <- ldatuning::FindTopicsNumber(AssociatedPress, topics = c(1:10),
metrics = c("Griffiths2004", "CaoJuan2009",
"Arun2010", "Deveaud2014"),
method = "Gibbs", control = list(seed = 1234),
mc.cores = parallel::detectCores() - 1,
verbose = T)
#> warning: topics count can't to be less than 2, incorrect values was removed.
#> fit models... done.
#> calculate metrics:
#> Griffiths2004... done.
#> CaoJuan2009... done.
#> Arun2010... done.
#> Deveaud2014... done.
>sessionInfo()
R version 4.0.3 (2020-10-10)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Big Sur 10.16
Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib
locale:
[1] en_AU.UTF-8/en_AU.UTF-8/en_AU.UTF-8/C/en_AU.UTF-8/en_AU.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] ldatuning_1.0.2 topicmodels_0.2-12
loaded via a namespace (and not attached):
[1] readxl_1.3.1 backports_1.2.1 Hmisc_4.5-0
[4] systemfonts_1.0.1 plyr_1.8.6 splines_4.0.3
[7] gmp_0.6-2 tfruns_1.5.0 usethis_2.0.1
[10] ggplot2_3.3.3 digest_0.6.27 htmltools_0.5.1.9000
[13] matrixcalc_1.0-3 viridis_0.5.1 fansi_0.4.2
[16] magrittr_2.0.1 checkmate_2.0.0 memoise_2.0.0
[19] tm_0.7-8 cluster_2.1.1 openxlsx_4.2.3
[22] remotes_2.2.0 readr_1.4.0 extrafont_0.17
[25] vroom_1.4.0 extrafontdb_1.0 prettyunits_1.1.1
[28] jpeg_0.1-8.1 sem_3.1-11 colorspace_2.0-1
[31] haven_2.3.1 xfun_0.22 dplyr_1.0.5
[34] jsonlite_1.7.2 callr_3.6.0 crayon_1.4.1
[37] microbenchmark_1.4-7 lme4_1.1-26 zeallot_0.1.0
[40] survival_3.2-10 zoo_1.8-9 glue_1.4.2
[43] gtable_0.3.0 mi_1.0 car_3.0-10
[46] pkgbuild_1.2.0 Rttf2pt1_1.3.8 Rmpfr_0.8-4
[49] abind_1.4-5 scales_1.1.1 DBI_1.1.1
[52] rstatix_0.7.0 Rcpp_1.0.6 viridisLite_0.4.0
[55] htmlTable_2.1.0 tmvnsim_1.0-2 reticulate_1.18
[58] foreign_0.8-81 bit_4.0.4 Formula_1.2-4
[61] stats4_4.0.3 htmlwidgets_1.5.3 RColorBrewer_1.1-2
[64] lavaan_0.6-8 modeltools_0.2-23 ellipsis_0.3.2
[67] pkgconfig_2.0.3 rJava_0.9-13 farver_2.1.0
[70] nnet_7.3-15 utf8_1.2.1 janitor_2.1.0
[73] tidyselect_1.1.0 rlang_0.4.11 munsell_0.5.0
[76] cellranger_1.1.0 tools_4.0.3 cachem_1.0.5
[79] cli_2.5.0 generics_0.1.0 devtools_2.3.2
[82] broom_0.7.5 evaluate_0.14 stringr_1.4.0
[85] fastmap_1.1.0 arm_1.11-2 yaml_2.2.1
[88] processx_3.5.0 knitr_1.31 bit64_4.0.5
[91] fs_1.5.0 zip_2.1.1 purrr_0.3.4
[94] randomForest_4.6-14 nlme_3.1-152 whisker_0.4
[97] slam_0.1-48 xml2_1.3.2 compiler_4.0.3
[100] rstudioapi_0.13 curl_4.3.1 png_0.1-7
[103] testthat_3.0.2 ggsignif_0.6.1 gt_0.2.2
[106] reprex_1.0.0 tibble_3.1.1 statmod_1.4.35
[109] pbivnorm_0.6.0 stringi_1.5.3 ps_1.6.0
[112] desc_1.3.0 gdtools_0.2.3 forcats_0.5.1
[115] hrbrthemes_0.8.0 lattice_0.20-41 Matrix_1.3-2
[118] tensorflow_2.4.0 keras_2.4.0 Amelia_1.7.6
[121] nloptr_1.2.2.2 tabulizerjars_1.0.1 vctrs_0.3.8
[124] pillar_1.6.1 lifecycle_1.0.0 BiocManager_1.30.12
[127] data.table_1.14.0 cowplot_1.1.1 R6_2.5.0
[130] latticeExtra_0.6-29 gridExtra_2.3 rio_0.5.26
[133] sessioninfo_1.1.1 boot_1.3-27 MASS_7.3-53.1
[136] assertthat_0.2.1 pkgload_1.2.0 rprojroot_2.0.2
[139] withr_2.4.2 mnormt_2.0.2 parallel_4.0.3
[142] hms_1.0.0 grid_4.0.3 rpart_4.1-15
[145] labelled_2.8.0 tidyr_1.1.3 coda_0.19-4
[148] minqa_1.2.4 rmarkdown_2.7 snakecase_0.11.0
[151] carData_3.0-4 NLP_0.2-1 snowfall_1.84-6.1
[154] lubridate_1.7.10 base64enc_0.1-3 bmem_1.8
[157] tabulizer_0.2.2
Related
I am trying to install the trackViewer package in R, following the instructions on the Bioconductor websites https://www.bioconductor.org/packages/devel/bioc/vignettes/trackViewer/inst/doc/trackViewer.html.
https://bioconductor.org/packages/release/bioc/html/trackViewer.html
Every time I run the code
if (!require("BiocManager", quietly = TRUE))
install.packages("BiocManager")
BiocManager::install("trackViewer")
if (!require("BiocManager", quietly = TRUE))
install.packages("BiocManager")
BiocManager::install("Gviz")
I get this error
'getOption("repos")' replaces Bioconductor standard repositories, see '?repositories' for details
replacement repositories:
CRAN: https://cran.rstudio.com/
Bioconductor version 3.15 (BiocManager 1.30.18), R 4.2.1 (2022-06-23)
Warning message:
package(s) not installed when version(s) same as current; use `force = TRUE` to re-install: 'Gviz'
I'm not sure how to circumvent this. I am ultimately looking to create a lollipop plot to showcase mutations in a gene of interest with annotations.
I would appreciate any help with this.
Session info:
R version 4.2.1 (2022-06-23)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Monterey 12.0.1
Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRlapack.dylib
locale:
[1] en_GB.UTF-8/en_GB.UTF-8/en_GB.UTF-8/C/en_GB.UTF-8/en_GB.UTF-8
attached base packages:
[1] grid stats4 stats graphics grDevices utils datasets methods
[9] base
other attached packages:
[1] Rcpp_1.0.9 GenomicRanges_1.48.0 GenomeInfoDb_1.32.3 IRanges_2.30.0
[5] S4Vectors_0.34.0 BiocGenerics_0.42.0 BiocManager_1.30.18
loaded via a namespace (and not attached):
[1] MatrixGenerics_1.8.1 Biobase_2.56.0 httr_1.4.3
[4] bit64_4.0.5 assertthat_0.2.1 BiocFileCache_2.4.0
[7] blob_1.2.3 BSgenome_1.64.0 GenomeInfoDbData_1.2.8
[10] Rsamtools_2.12.0 yaml_2.3.5 progress_1.2.2
[13] pillar_1.8.0 RSQLite_2.2.16 lattice_0.20-45
[16] glue_1.6.2 digest_0.6.29 RColorBrewer_1.1-3
[19] XVector_0.36.0 colorspace_2.0-3 htmltools_0.5.3
[22] Matrix_1.4-1 XML_3.99-0.10 pkgconfig_2.0.3
[25] biomaRt_2.52.0 zlibbioc_1.42.0 purrr_0.3.4
[28] scales_1.2.0 BiocParallel_1.30.3 tibble_3.1.8
[31] KEGGREST_1.36.3 generics_0.1.3 ellipsis_0.3.2
[34] cachem_1.0.6 SummarizedExperiment_1.26.1 GenomicFeatures_1.48.3
[37] cli_3.3.0 magrittr_2.0.3 crayon_1.5.1
[40] memoise_2.0.1 fansi_1.0.3 xml2_1.3.3
[43] tools_4.2.1 prettyunits_1.1.1 hms_1.1.1
[46] BiocIO_1.6.0 lifecycle_1.0.1 matrixStats_0.62.0
[49] stringr_1.4.0 munsell_0.5.0 DelayedArray_0.22.0
[52] AnnotationDbi_1.58.0 Biostrings_2.64.0 compiler_4.2.1
[55] rlang_1.0.4 RCurl_1.98-1.8 rstudioapi_0.13
[58] rjson_0.2.21 rappdirs_0.3.3 htmlwidgets_1.5.4
[61] bitops_1.0-7 restfulr_0.0.15 codetools_0.2-18
[64] DBI_1.1.3 curl_4.3.2 R6_2.5.1
[67] GenomicAlignments_1.32.1 dplyr_1.0.9 rtracklayer_1.56.1
[70] fastmap_1.1.0 bit_4.0.4 utf8_1.2.2
[73] filelock_1.0.2 stringi_1.7.8 parallel_4.2.1
[76] vctrs_0.4.1 png_0.1-7 dbplyr_2.2.1
[79] tidyselect_1.1.2
Here warning message suggests that latest version of the package is already installed and if you want to reinstall the package then use force=TRUE like this :
BiocManager::install("Gviz", force = TRUE)
I've been regularly loading data from my company database. Yesterday I installed R 4.1.3. Since then, the encoding of the data I load using pool is messed up. Not sure what encoding is used, but I'd need UTF-8.
I checked on my colleague's computer, who is still running R 4.1.2, and with the exact same code he doesn't have that issue. Any idea why? And possibly if I can set a global parameter for that?
My session info:
> sessionInfo()
R version 4.1.3 (2022-03-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 22000)
Matrix products: default
locale:
[1] LC_COLLATE=English_Switzerland.1252 LC_CTYPE=English_Switzerland.1252 LC_MONETARY=English_Switzerland.1252 LC_NUMERIC=C
[5] LC_TIME=English_Switzerland.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] showtext_0.9-5 showtextdb_3.0 sysfonts_0.8.8 ggnewscale_0.4.6 scales_1.1.1 hrbrthemes_0.8.0 ggthemes_4.2.4 pool_0.1.6
[9] highcharter_0.9.4 reshape2_1.4.4 lubridate_1.8.0 zoo_1.8-9 viridis_0.6.2 viridisLite_0.4.0 forcats_0.5.1 stringr_1.4.0
[17] dplyr_1.0.8 purrr_0.3.4 readr_2.1.2 tidyr_1.2.0 tibble_3.1.6 ggplot2_3.3.5 tidyverse_1.3.1
loaded via a namespace (and not attached):
[1] httr_1.4.2 RMySQL_0.10.23 jsonlite_1.8.0 modelr_0.1.8 assertthat_0.2.1 TTR_0.24.3 cellranger_1.1.0 yaml_2.3.5
[9] gdtools_0.2.4 Rttf2pt1_1.3.10 pillar_1.7.0 backports_1.4.1 lattice_0.20-45 glue_1.6.2 rlist_0.4.6.2 extrafontdb_1.0
[17] digest_0.6.29 rvest_1.0.2 colorspace_2.0-3 htmltools_0.5.2 plyr_1.8.6 pkgconfig_2.0.3 broom_0.7.12 haven_2.4.3
[25] later_1.3.0 tzdb_0.2.0 generics_0.1.2 ellipsis_0.3.2 withr_2.5.0 cli_3.2.0 quantmod_0.4.18 magrittr_2.0.2
[33] crayon_1.5.0 readxl_1.3.1 evaluate_0.15 fs_1.5.2 fansi_1.0.2 xts_0.12.1 xml2_1.3.3 data.table_1.14.2
[41] tools_4.1.3 hms_1.1.1 lifecycle_1.0.1 munsell_0.5.0 reprex_2.0.1 compiler_4.1.3 systemfonts_1.0.4 rlang_1.0.2
[49] grid_4.1.3 rstudioapi_0.13 htmlwidgets_1.5.4 igraph_1.2.11 rmarkdown_2.13 gtable_0.3.0 DBI_1.1.2 curl_4.3.2
[57] R6_2.5.1 gridExtra_2.3 knitr_1.37 fastmap_1.1.0 extrafont_0.17 utf8_1.2.2 stringi_1.7.6 Rcpp_1.0.8.3
I'm trying to install some packages which require compilation in R. I installed RTools from the website and was having the error that "RTools must be installed to build packages". I installed it again directly from Rstudio and am no longer having the same issue. However, I can't install the packages because of an error that path is not writable.
When trying to execute the command BiocManager::install("org.Rn.eg.db")
I get the following output and error message
'getOption("repos")' replaces Bioconductor standard repositories, see '?repositories' for details
replacement repositories:
CRAN: https://cran.rstudio.com/
Bioconductor version 3.14 (BiocManager 1.30.16), R 4.1.0 (2021-05-18)
Installing package(s) 'org.Rn.eg.db'
installing the source package ‘org.Rn.eg.db’
trying URL 'https://bioconductor.org/packages/3.14/data/annotation/src/contrib/org.Rn.eg.db_3.13.0.tar.gz'
Content type 'application/x-gzip' length 57471764 bytes (54.8 MB)
downloaded 54.8 MB
'"C:\PROGRA~1\R\R-41~1.0/bin/x64/Rterm.exe"' is not recognized as an internal or external command,
operable program or batch file.
The downloaded source packages are in
‘##MY PATH’
Installation paths not writeable, unable to update packages
path: C:/Program Files/R/R-4.1.0/library
packages:
affy, affyio, airway, AnnotationDbi, Biobase, BiocGenerics, BiocVersion, biomaRt, Biostrings, broom, colorspace, curl,
DelayedArray, devtools, dplyr, edgeR, EnhancedVolcano, fansi, GenomeInfoDb, GenomicRanges, gert, graph, Heatplus, IRanges,
KEGGREST, limma, marray, MatrixGenerics, mime, preprocessCore, S4Vectors, STRINGdb, SummarizedExperiment, topGO, VennDetail,
xfun, XVector, zip, zlibbioc
Old packages: 'BiocFileCache', 'BiocParallel', 'DESeq2', 'genefilter', 'glmnet', 'GSEABase', 'lme4', 'openxlsx', 'rio',
'stringi'
Update all/some/none? [a/s/n]:
n
Warning message:
In .inet_warning(msg) :
installation of package ‘org.Rn.eg.db’ had non-zero exit status
From running sessionInfo()
R version 4.1.0 (2021-05-18)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19043)
Matrix products: default
locale:
[1] LC_COLLATE=English_Canada.1252 LC_CTYPE=English_Canada.1252 LC_MONETARY=English_Canada.1252
[4] LC_NUMERIC=C LC_TIME=English_Canada.1252
attached base packages:
[1] parallel stats4 stats graphics grDevices utils datasets methods base
other attached packages:
[1] gprofiler2_0.2.0 DESeq2_1.32.0 SummarizedExperiment_1.22.0 Biobase_2.52.0
[5] MatrixGenerics_1.4.0 matrixStats_0.59.0 GenomicRanges_1.44.0 GenomeInfoDb_1.28.0
[9] IRanges_2.26.0 S4Vectors_0.30.0 BiocGenerics_0.38.0 factoextra_1.0.7
[13] dendextend_1.15.1 RColorBrewer_1.1-2 pheatmap_1.0.12 ggpubr_0.4.0
[17] ggtext_0.1.1 forcats_0.5.1 stringr_1.4.0 dplyr_1.0.6
[21] purrr_0.3.4 readr_1.4.0 tidyr_1.1.3 tibble_3.1.2
[25] tidyverse_1.3.1 EnhancedVolcano_1.10.0 ggrepel_0.9.1 ggplot2_3.3.4
loaded via a namespace (and not attached):
[1] readxl_1.3.1 backports_1.2.1 lazyeval_0.2.2 splines_4.1.0 BiocParallel_1.26.0
[6] digest_0.6.27 htmltools_0.5.1.1 viridis_0.6.1 fansi_0.5.0 magrittr_2.0.1
[11] memoise_2.0.0 openxlsx_4.2.3 Biostrings_2.61.1 annotate_1.71.0 modelr_0.1.8
[16] extrafont_0.17 extrafontdb_1.0 colorspace_2.0-1 blob_1.2.1 rvest_1.0.0
[21] haven_2.4.1 xfun_0.24 crayon_1.4.1 RCurl_1.98-1.3 jsonlite_1.7.2
[26] genefilter_1.74.0 survival_3.2-11 glue_1.4.2 gtable_0.3.0 zlibbioc_1.39.0
[31] XVector_0.33.0 DelayedArray_0.19.0 proj4_1.0-10.1 car_3.0-10 Rttf2pt1_1.3.8
[36] maps_3.3.0 abind_1.4-5 scales_1.1.1 DBI_1.1.1 rstatix_0.7.0
[41] Rcpp_1.0.6 viridisLite_0.4.0 xtable_1.8-4 gridtext_0.1.4 foreign_0.8-81
[46] bit_4.0.4 htmlwidgets_1.5.3 httr_1.4.2 ellipsis_0.3.2 farver_2.1.0
[51] pkgconfig_2.0.3 XML_3.99-0.6 dbplyr_2.1.1 locfit_1.5-9.4 utf8_1.2.1
[56] labeling_0.4.2 tidyselect_1.1.1 rlang_0.4.11 AnnotationDbi_1.54.1 munsell_0.5.0
[61] cellranger_1.1.0 tools_4.1.0 cachem_1.0.5 cli_2.5.0 generics_0.1.0
[66] RSQLite_2.2.7 broom_0.7.7 fastmap_1.1.0 knitr_1.33 bit64_4.0.5
[71] fs_1.5.0 zip_2.2.0 KEGGREST_1.33.0 ash_1.0-15 ggrastr_0.2.3
[76] xml2_1.3.2 compiler_4.1.0 rstudioapi_0.13 beeswarm_0.4.0 plotly_4.9.4.1
[81] curl_4.3.1 png_0.1-7 ggsignif_0.6.2 reprex_2.0.0 geneplotter_1.71.0
[86] stringi_1.6.1 ggalt_0.4.0 lattice_0.20-44 Matrix_1.3-4 markdown_1.1
[91] vctrs_0.3.8 pillar_1.6.1 lifecycle_1.0.0 BiocManager_1.30.16 data.table_1.14.0
[96] bitops_1.0-7 R6_2.5.0 KernSmooth_2.23-20 gridExtra_2.3 rio_0.5.26
[101] vipor_0.4.5 MASS_7.3-54 assertthat_0.2.1 withr_2.4.2 GenomeInfoDbData_1.2.6
[106] hms_1.1.0 grid_4.1.0 carData_3.0-4 lubridate_1.7.10 ggbeeswarm_0.6.0
I met the exact same problem as you at the first use after installing the newest R and Rstudio. Then I just run Rstuio as Administrator and it worked. You can refer to the similar question for other solutions: https://community.rstudio.com/t/error-after-r-update-lib-c-program-files-r-r-3-5-0-library-is-not-writable/7947/2
I have a problem with converting ggplots into rayshader 3d graphs. I have tested many different examples on the rayshader homepage but it just won't work. For example this code I have from the demonstration examples of the official homepage:
library(rayshader)
library(ggplot2)
mtplot = ggplot(mtcars) +
geom_point(aes(x=mpg,y=disp,color=cyl)) +
scale_color_continuous(limits=c(0,8))
plot_gg(mtplot, width=3.5, multicore = TRUE, windowsize = c(1400,866), sunangle=225,
zoom = 0.60, phi = 30, theta = 45)
When I execute this code the x11 windows opens but it is blank and looks like this. when I use preview=T it works fine since the x11 windows does not open. When I close this blank window my R session is aborted and in the console it says:
pure virtual method called. I have no clue how to get rid of the problem, I could not find anything on the internet so far.
this is my session info:
R version 4.1.0 (2021-05-18)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19041)
Matrix products: default
locale:
[1] LC_COLLATE=German_Germany.1252 LC_CTYPE=German_Germany.1252 LC_MONETARY=German_Germany.1252
[4] LC_NUMERIC=C LC_TIME=German_Germany.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] ggplot2_3.3.3 rayshader_0.24.11
loaded via a namespace (and not attached):
[1] Rcpp_1.0.6 pillar_1.6.1 compiler_4.1.0 later_1.2.0
[5] prettyunits_1.1.1 iterators_1.0.13 tools_4.1.0 progress_1.2.2
[9] digest_0.6.27 tibble_3.1.2 jsonlite_1.7.2 lifecycle_1.0.0
[13] gtable_0.3.0 pkgconfig_2.0.3 rlang_0.4.11 foreach_1.5.1
[17] DBI_1.1.1 shiny_1.6.0 crosstalk_1.1.1 parallel_4.1.0
[21] xfun_0.23 fastmap_1.1.0 withr_2.4.2 dplyr_1.0.6
[25] knitr_1.33 generics_0.1.0 vctrs_0.3.8 htmlwidgets_1.5.3
[29] hms_1.1.0 tidyselect_1.1.1 manipulateWidget_0.10.1 webshot_0.5.2
[33] grid_4.1.0 glue_1.4.2 R6_2.5.0 fansi_0.4.2
[37] rgl_0.106.8 purrr_0.3.4 magrittr_2.0.1 scales_1.1.1
[41] codetools_0.2-18 promises_1.2.0.1 ellipsis_0.3.2 htmltools_0.5.1.1
[45] assertthat_0.2.1 mime_0.10 xtable_1.8-4 colorspace_2.0-1
[49] httpuv_1.6.1 utf8_1.2.1 miniUI_0.1.1.1 doParallel_1.0.16
[53] munsell_0.5.0 crayon_1.4.1
I just got a new Acer Swift laptop and installed ubuntu 20.04 on it. I installed R.4.0.3 and Rstudio 1.2.5042
I tried to run a script that is running without problems on my old computer. R crashes and Rstudio aborts when I assign one matrix to another. I tried increasing R memory (it is inf now) and doing the same assignment using matrix subsets. It still crashes. R session is also aborted if I skip the matrix assignment and just try to do other manipulations with the matrix ext_data.df
FYI: data.input is a matrix 33538 x 11366. ext_data.df is properly initialiozed. It is only at the assignment
ext_data.df[common_genes,] = data.input[common_genes,]
that the crash happens.
ext_data.df=matrix(0,dim(gene_list)[1],dim(data.input)[2])
rownames(ext_data.df) = gene_list$X2
colnames(ext_data.df) <- colnames(data.input)
common_genes = intersect(gene_list$X2,rownames(data.input))
ext_data.df[common_genes,] = data.input[common_genes,]
sessionInfo()
R version 4.0.3 (2020-10-10)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04.1 LTS
Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/openblas-serial/libblas.so.3
LAPACK: /usr/lib/x86_64-linux-gnu/openblas-serial/liblapack.so.3
locale:
[1] LC_CTYPE=en_SG.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_SG.UTF-8 LC_COLLATE=en_SG.UTF-8
[5] LC_MONETARY=en_SG.UTF-8 LC_MESSAGES=en_SG.UTF-8
[7] LC_PAPER=en_SG.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_SG.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] tensorflow_2.2.0 kknn_1.3.1 plotly_4.9.3 viridis_0.5.1
[5] viridisLite_0.3.0 KernelKnn_1.1.0 forcats_0.5.0 stringr_1.4.0
[9] dplyr_1.0.3 purrr_0.3.4 readr_1.4.0 tidyr_1.1.2
[13] tibble_3.0.5 tidyverse_1.3.0 keras_2.3.0.0 ggpubr_0.4.0
[17] ggplot2_3.3.3 ggsci_2.9 class_7.3-17 Seurat_3.2.3
loaded via a namespace (and not attached):
[1] readxl_1.3.1 backports_1.2.1 plyr_1.8.6
[4] igraph_1.2.6 lazyeval_0.2.2 splines_4.0.3
[7] listenv_0.8.0 scattermore_0.7 tfruns_1.4
[10] digest_0.6.27 htmltools_0.5.1.1 fansi_0.4.2
[13] magrittr_2.0.1 tensor_1.5 cluster_2.1.0
[16] ROCR_1.0-11 openxlsx_4.2.3 globals_0.14.0
[19] modelr_0.1.8 matrixStats_0.57.0 askpass_1.1
[22] colorspace_2.0-0 rvest_0.3.6 rappdirs_0.3.1
[25] ggrepel_0.9.1 haven_2.3.1 crayon_1.3.4
[28] jsonlite_1.7.2 spatstat_1.64-1 spatstat.data_1.7-0
[31] zeallot_0.1.0 survival_3.2-7 zoo_1.8-8
[34] glue_1.4.2 polyclip_1.10-0 gtable_0.3.0
[37] leiden_0.3.7 car_3.0-10 future.apply_1.7.0
[40] abind_1.4-5 scales_1.1.1 DBI_1.1.1
[43] rstatix_0.6.0 miniUI_0.1.1.1 Rcpp_1.0.6
[46] xtable_1.8-4 reticulate_1.18 foreign_0.8-81
[49] rsvd_1.0.3 umap_0.2.7.0 htmlwidgets_1.5.3
[52] httr_1.4.2 RColorBrewer_1.1-2 ellipsis_0.3.1
[55] ica_1.0-2 pkgconfig_2.0.3 uwot_0.1.10
[58] dbplyr_2.0.0 deldir_0.2-9 tidyselect_1.1.0
[61] rlang_0.4.10 reshape2_1.4.4 later_1.1.0.1
[64] munsell_0.5.0 cellranger_1.1.0 tools_4.0.3
[67] cli_2.2.0 generics_0.1.0 broom_0.7.3
[70] ggridges_0.5.3 fastmap_1.1.0 goftest_1.2-2
[73] fs_1.5.0 fitdistrplus_1.1-3 zip_2.1.1
[76] RANN_2.6.1 pbapply_1.4-3 future_1.21.0
[79] nlme_3.1-151 whisker_0.4 mime_0.9
[82] xml2_1.3.2 compiler_4.0.3 rstudioapi_0.13
[85] curl_4.3 png_0.1-7 ggsignif_0.6.0
[88] spatstat.utils_2.0-0 reprex_0.3.0 stringi_1.5.3
[91] RSpectra_0.16-0 lattice_0.20-41 Matrix_1.3-2
[94] vctrs_0.3.6 pillar_1.4.7 lifecycle_0.2.0
[97] lmtest_0.9-38 RcppAnnoy_0.0.18 data.table_1.13.6
[100] cowplot_1.1.1 irlba_2.3.3 httpuv_1.5.5
[103] patchwork_1.1.1 R6_2.5.0 promises_1.1.1
[106] KernSmooth_2.23-18 gridExtra_2.3 rio_0.5.16
[109] parallelly_1.23.0 codetools_0.2-18 MASS_7.3-53
[112] assertthat_0.2.1 openssl_1.4.3 withr_2.4.0
[115] sctransform_0.3.2 mgcv_1.8-33 parallel_4.0.3
[118] hms_1.0.0 grid_4.0.3 rpart_4.1-15
[121] carData_3.0-4 Rtsne_0.15 shiny_1.6.0
[124] lubridate_1.7.9.2 base64enc_0.1-3
Could you please help me solve the problem?
Thank you very much!
Could it be that you are using 32 bit version of R?
32 bit applications can only access a maximum of 4 Gigs of memory.
Can you try the following
.Machine$sizeof.pointer
it should return 8 if you are using 64 bit R
Update: It is clearly a memory problem. When I try to do the assignment
ext_data.df[common_genes,1:1000]=data.input[common_genes, 1:1000] it works.
I monitored the usage with mem_used() and found that it works up to 7.8GB (it happens for ext_data.df[common_genes,1:3000]=data.input[common_genes, 1:3000].
At 8GB, the R session gets aborted. How can I increase the memory above 8GB. In my old laptop (MacBook Pro), the mem_used was 8.21GB for the whole assignment.
I have to note that I use Sys.setenv('R_MAX_MEM_SIZE'=64000000000)
and Sys.setenv('R_MAX_VSIZE'=64000000000) in the beginning of my script.
Maybe you can try increasing the memory via memory.limit().
You can refer to this stackoverflow thread for more information:
Increasing (or decreasing) the memory available to R processes