Maximal number of DLLs reached - r

I get this error in R when trying to load new libraries.
Installation failed: unable to load shared object 'C:/R/R-3.4.0/library/curl/libs/x64/curl.dll':
`maximal number of DLLs reached...
It's nothing to do with curl, it could be any library. My sessionInfo looks like below:
R version 3.4.0 (2017-04-21)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1
Matrix products: default
locale:
[1] LC_COLLATE=English_United Kingdom.1252
[2] LC_CTYPE=English_United Kingdom.1252
[3] LC_MONETARY=English_United Kingdom.1252
[4] LC_NUMERIC=C
[5] LC_TIME=English_United Kingdom.1252
attached base packages:
[1] parallel stats graphics grDevices utils datasets
[7] methods base
other attached packages:
[1] M3Drop_1.2.0 numDeriv_2016.8-1 bindrcpp_0.2
[4] Seurat_2.0.1 Matrix_1.2-11 cowplot_0.8.0
[7] scater_1.4.0 Biobase_2.36.2 BiocGenerics_0.22.0
[10] tidyr_0.6.3 dplyr_0.7.2 ggplot2_2.2.1
[13] extrafont_0.17
loaded via a namespace (and not attached):
[1] shinydashboard_0.6.1 R.utils_2.5.0
[3] lme4_1.1-13 RSQLite_2.0
[5] AnnotationDbi_1.38.2 htmlwidgets_0.9
[7] grid_3.4.0 trimcluster_0.1-2
[9] ranger_0.8.0 BiocParallel_1.10.1
[11] Rtsne_0.13 devtools_1.13.3
[13] munsell_0.4.3 codetools_0.2-15
[15] ica_1.0-1 captioner_2.2.3
[17] statmod_1.4.30 withr_2.0.0
[19] colorspace_1.3-2 knitr_1.16
[21] stats4_3.4.0 ROCR_1.0-7
[23] robustbase_0.92-7 dtw_1.18-1
[25] Rttf2pt1_1.3.4 NMF_0.20.6
[27] labeling_0.3 lars_1.2
[29] tximport_1.4.0 bbmle_1.0.19
[31] GenomeInfoDbData_0.99.0 mnormt_1.5-5
[33] bit64_0.9-7 rhdf5_2.20.0
[35] diptest_0.75-7 R6_2.2.2
[37] doParallel_1.0.10 GenomeInfoDb_1.12.2
[39] ggbeeswarm_0.6.0 VGAM_1.0-4
[41] locfit_1.5-9.1 flexmix_2.3-14
[43] bitops_1.0-6 DelayedArray_0.2.7
[45] assertthat_0.2.0 SDMTools_1.1-221
[47] scales_0.4.1 nnet_7.3-12
[49] ggjoy_0.3.0 beeswarm_0.2.3
[51] gtable_0.2.0 rlang_0.1.2
[53] MatrixModels_0.4-1 genefilter_1.58.1
[55] scatterplot3d_0.3-40 splines_3.4.0
[57] extrafontdb_1.0 lazyeval_0.2.0
[59] ModelMetrics_1.1.0 acepack_1.4.1
[61] checkmate_1.8.3 reshape2_1.4.2
[63] backports_1.1.0 httpuv_1.3.5
[65] Hmisc_4.0-3 caret_6.0-76
[67] tools_3.4.0 gridBase_0.4-7
[69] gplots_3.0.1 RColorBrewer_1.1-2
[71] proxy_0.4-17 Rcpp_0.12.12
[73] plyr_1.8.4 base64enc_0.1-3
[75] zlibbioc_1.22.0 purrr_0.2.3
[77] RCurl_1.95-4.8 rpart_4.1-11
[79] pbapply_1.3-3 viridis_0.4.0
[81] S4Vectors_0.14.3 SummarizedExperiment_1.6.3
[83] cluster_2.0.6 magrittr_1.5
[85] data.table_1.10.4 SparseM_1.77
[87] mvtnorm_1.0-6 matrixStats_0.52.2
[89] mime_0.5 xtable_1.8-2
[91] pbkrtest_0.4-7 XML_3.98-1.9
[93] mclust_5.3 IRanges_2.10.2
[95] gridExtra_2.2.1 compiler_3.4.0
[97] biomaRt_2.32.1 tibble_1.3.3
[99] KernSmooth_2.23-15 minqa_1.2.4
[101] R.oo_1.21.0 htmltools_0.3.6
[103] segmented_0.5-2.1 mgcv_1.8-18
[105] Formula_1.2-2 geneplotter_1.54.0
[107] tclust_1.2-7 DBI_0.7
[109] diffusionMap_1.1-0 MASS_7.3-47
[111] fpc_2.1-10 car_2.1-5
[113] R.methodsS3_1.7.1 gdata_2.18.0
[115] bindr_0.1 igraph_1.1.2
[117] GenomicRanges_1.28.4 pkgconfig_2.0.1
[119] sn_1.5-0 registry_0.3
[121] foreign_0.8-69 foreach_1.4.3
[123] annotate_1.54.0 vipor_0.4.5
[125] rngtools_1.2.4 pkgmaker_0.22
[127] XVector_0.16.0 stringr_1.2.0
[129] digest_0.6.12 tsne_0.1-3
[131] htmlTable_1.9 edgeR_3.18.1
[133] kernlab_0.9-25 shiny_1.0.4
[135] gtools_3.5.0 quantreg_5.33
[137] modeltools_0.2-21 rjson_0.2.15
[139] nloptr_1.0.4 nlme_3.1-131
[141] viridisLite_0.2.0 limma_3.32.5
[143] lattice_0.20-35 httr_1.3.0
[145] DEoptimR_1.0-8 survival_2.41-3
[147] glue_1.1.1 FNN_1.1
[149] prabclus_2.2-6 iterators_1.0.8
[151] bit_1.1-12 class_7.3-14
[153] stringi_1.1.5 mixtools_1.1.0
[155] blob_1.1.0 DESeq2_1.16.1
[157] latticeExtra_0.6-28 caTools_1.17.1
[159] memoise_1.1.0 irlba_2.2.1
[161] ape_4.1
I am on windows and I tried Sys.setenv(R_MAX_NUM_DLLS=500), from this question, but it doesn't seem to do anything. I have tried to add it to the Rprofile.site file and restarted R but I still get the error. Unloading libraries or not loading so many libraries etc is not a solution. I have seen an option to add R_MAX_NUM_DLLS=500 to .Renviron file, but I am not sure if windows has this.
I was wondering if anyone has any insight.

Try adding the new environment variable, in System Properties.

System environment variable R_MAX_NUM_DLLS is one of several variables that must be set before or very early on in the R startup process. It is too late to set it .Rprofile. However, you can set it in ~/.Renviron, which should then contain a line with:
R_MAX_NUM_DLLS=500
This works on all platforms / operating systems including Windows. The tricky part on Windows is to figure out where the file should be located. The easiest way to figure this out is to call:
> normalizePath("~/.Renviron", mustWork = FALSE)
[1] "/home/alice/.Renviron"
On Windows, you may see something like:
> normalizePath("~/.Renviron", mustWork = FALSE)
[1] "C:\\Users\\alice\\Documents\\.Renviron"
Note how ~/ points to C:\\Users\\alice\\Documents\\ and not to C:\\Users\\alice\\ as one might expect if one comes from a Unix environment.

Related

R session is aborted when I assign one matrix to another

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

RStudio Viewer Error: "session/viewhtml...." not found

I recently installed a daily build version of R Studio, 1.4.671. Since that installation, anything that runs in the viewer (e.g. gt or lavaanPlot) gives me an error like this:
/session/viewhtml528813ce72d/index.html?viewer_pane=1&capabilities=1&host=http%3A%2F%2F127.0.0.1%3A27742 not found
I have fully uninstalled 1.4.671, restarted my computer, and reinstalled the version that worked this morning, 1.3.1056. Not sure
This is becoming quite a problem because I am not able to easily see any model coefficients that I am currently working on (in a neat way, they are messy in the console).
I have also reset RStudio's state following https://support.rstudio.com/hc/en-us/articles/200534577-Resetting-RStudio-s-State and removed my .Renviron file.
Update: if the error shows but I choose to export as HTML, the HTML file works.
Update2: both running Shiny and knitting an RMarkdown document to HTML works. It's just displaying something inside RStudio's viewer that is causing issues.
R version 4.0.0 (2020-04-24)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 17763)
Matrix products: default
locale:
[1] LC_COLLATE=English_United States.1252
[2] LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods
[7] base
other attached packages:
[1] gt_0.2.1 patchwork_1.0.0 waffle_1.0.1
[4] plotly_4.9.2.1 ggstance_0.3.4 ggridges_0.5.2
[7] foreign_0.8-78 gghighlight_0.3.0 gridExtra_2.3
[10] readxl_1.3.1 emmeans_1.4.7 broom_0.5.6
[13] fastDummies_1.6.1 modelsummary_0.5.0 tables_0.9.3
[16] gtsummary_1.3.2 janitor_2.0.1 haven_2.3.1
[19] forcats_0.5.0 stringr_1.4.0 dplyr_1.0.0
[22] purrr_0.3.4 readr_1.3.1 tidyr_1.1.0
[25] tibble_3.0.1 ggplot2_3.3.1 tidyverse_1.3.0
loaded via a namespace (and not attached):
[1] nlme_3.1-147 fs_1.4.1 lubridate_1.7.8
[4] RColorBrewer_1.1-2 httr_1.4.1 tools_4.0.0
[7] backports_1.1.7 DT_0.13 R6_2.4.1
[10] DBI_1.1.0 lazyeval_0.2.2 colorspace_1.4-1
[13] withr_2.2.0 tidyselect_1.1.0 extrafontdb_1.0
[16] curl_4.3 compiler_4.0.0 cli_2.0.2
[19] rvest_0.3.5 xml2_1.3.2 sandwich_2.5-1
[22] labeling_0.3 sass_0.2.0 scales_1.1.1
[25] checkmate_2.0.0 mvtnorm_1.1-0 commonmark_1.7
[28] digest_0.6.25 rmarkdown_2.2 pkgconfig_2.0.3
[31] htmltools_0.5.0 extrafont_0.17 dbplyr_1.4.4
[34] htmlwidgets_1.5.1 rlang_0.4.6 rstudioapi_0.11
[37] farver_2.0.3 generics_0.0.2 zoo_1.8-8
[40] jsonlite_1.6.1 magrittr_1.5 Matrix_1.2-18
[43] Rcpp_1.0.4.6 munsell_0.5.0 fansi_0.4.1
[46] lifecycle_0.2.0 stringi_1.4.6 multcomp_1.4-13
[49] yaml_2.2.1 snakecase_0.11.0 MASS_7.3-51.5
[52] plyr_1.8.6 grid_4.0.0 blob_1.2.1
[55] crayon_1.3.4 lattice_0.20-41 splines_4.0.0
[58] hms_0.5.3 knitr_1.28 pillar_1.4.4
[61] estimability_1.3 codetools_0.2-16 reprex_0.3.0
[64] glue_1.4.1 packrat_0.5.0 evaluate_0.14
[67] data.table_1.12.8 modelr_0.1.8 vctrs_0.3.0
[70] Rttf2pt1_1.3.8 cellranger_1.1.0 gtable_0.3.0
[73] assertthat_0.2.1 xfun_0.14 xtable_1.8-4
[76] coda_0.19-3 survival_3.1-12 viridisLite_0.3.0
[79] TH.data_1.0-10 ellipsis_0.3.1
>

How to print the sign "±" in a string in R (to place this character in a table like `kableextra`)

I want to print a plus minus sign of the form ± into a string in R, so that I can place that string a table with kableextra
Here is the structure of the string :
x = paste0("first_string", 2, "±", 3, "second_string", collapse = "")
However I get the following output:
"first_string2\302\2613second_string"
what should I do to have the output:
"first_string2±3second_string"
I found that \302\261 is the encoding for ± in Octal Escape Sequence according to this website or this website
EDIT Here is the output of sessionInfo():
R version 3.5.0 (2018-04-23)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS 10.14
Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRlapack.dylib
locale:
[1] C
attached base packages:
[1] splines stats graphics grDevices utils datasets methods base
other attached packages:
[1] bindrcpp_0.2.2 rms_5.1-2 SparseM_1.77 Hmisc_4.1-1 Formula_1.2-3
[6] lattice_0.20-35 blme_1.0-4 emmeans_1.2.4 lme4_1.1-18-1 Matrix_1.2-14
[11] multcomp_1.4-8 TH.data_1.0-8 MASS_7.3-49 mvtnorm_1.0-8 survminer_0.4.3
[16] survival_2.41-3 latex2exp_0.4.0 magick_1.9 cowplot_0.9.3 ggpubr_0.1.7
[21] magrittr_1.5 gridExtra_2.3 rcompanion_2.0.0 ggsignif_0.4.0 ggplot2_3.1.0
[26] chron_2.3-52 lubridate_1.7.4 dplyr_0.7.5 kableExtra_0.9.0 knitr_1.20
[31] broom_0.4.5
loaded via a namespace (and not attached):
[1] minqa_1.2.4 colorspace_1.3-2 class_7.3-14 modeltools_0.2-22
[5] rprojroot_1.3-2 estimability_1.3 htmlTable_1.12 base64enc_0.1-3
[9] rstudioapi_0.7 MatrixModels_0.4-1 manipulate_1.0.1 coin_1.2-2
[13] xml2_1.2.0 codetools_0.2-15 mnormt_1.5-5 nloptr_1.0.4
[17] km.ci_0.5-2 cluster_2.0.7-1 readr_1.1.1 compiler_3.5.0
[21] httr_1.3.1 backports_1.1.2 assertthat_0.2.0 lazyeval_0.2.1
[25] quantreg_5.36 acepack_1.4.1 htmltools_0.3.6 tools_3.5.0
[29] coda_0.19-1 gtable_0.2.0 glue_1.3.0 reshape2_1.4.3
[33] Rcpp_1.0.0 nlme_3.1-137 psych_1.8.4 lmtest_0.9-36
[37] stringr_1.3.1 rvest_0.3.2 polspline_1.1.13 zoo_1.8-2
[41] scales_1.0.0 hms_0.4.2 parallel_3.5.0 sandwich_2.4-0
[45] expm_0.999-2 RColorBrewer_1.1-2 yaml_2.1.19 BSDA_1.2.0
[49] KMsurv_0.1-5 EMT_1.1 rpart_4.1-13 latticeExtra_0.6-28
[53] stringi_1.2.4 nortest_1.0-4 e1071_1.6-8 checkmate_1.8.5
[57] boot_1.3-20 rlang_0.3.0.1 pkgconfig_2.0.1 evaluate_0.10.1
[61] purrr_0.2.5 bindr_0.1.1 labeling_0.3 htmlwidgets_1.2
[65] cmprsk_2.2-7 tidyselect_0.2.4 plyr_1.8.4 R6_2.3.0
[69] DescTools_0.99.25 multcompView_0.1-7 pillar_1.2.3 foreign_0.8-70
[73] withr_2.1.2 nnet_7.3-12 tibble_1.4.2 survMisc_0.5.5
[77] rmarkdown_1.10 grid_3.5.0 data.table_1.11.4 digest_0.6.18
[81] xtable_1.8-2 tidyr_0.8.1 stats4_3.5.0 munsell_0.5.0
[85] viridisLite_0.3.0
Locale settings control character sets for input and output. You have
locale:
[1] C
but if you want to print non-ASCII characters such as ±, you'll need something such as UTF-8. One example of how to accomplish this (which seems to have solved your issue per the comments) is
Sys.setlocale("LC_ALL","en_US.UTF-8")
paste0("first_string", 2, "±", 3, "second_string", collapse = "")
which should output
[1] "first_string2±3second_string"
For further information, I'd check out the following sources as a starting point:
R help page for getting or setting the locale
RStudio support on character encoding
readr's locale vignette

Error in lm(Sales ~ Discount, data = dtsample2) : unused argument (data = dtsample2)

While executing the following for linear regression the following error is thrown. The variables are numeric in the dataset.
dtsample2 <- read.csv("dtsample2.csv")
gt <- lm(Sales ~ Discount, data = dtsample2)
Error in lm(Sales ~ Discount, data = dtsample2) : unused argument
(data = dtsample2)
Please find the session info below.
sessionInfo()
R version 3.4.1 (2017-06-30)
Platform: i386-w64-mingw32/i386 (32-bit)
Running under: Windows 7 (build 7601) Service Pack 1
Matrix products: default
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] tcltk stats4 grid splines stats graphics grDevices utils datasets methods
[11] base
other attached packages:
[1] RcmdrPlugin.FuzzyClust_1.1 FactoMineR_1.36 RcmdrPlugin.EZR_1.35
[4] Hmisc_4.0-3 Formula_1.2-2 xtable_1.8-2
[7] forecast_8.1 xts_0.10-0 zoo_1.8-0
[10] tseries_0.10-42 TeachingDemos_2.10 RcmdrPlugin.EcoVirtual_1.0
[13] EcoVirtual_1.0 RcmdrPlugin.EBM_1.0-10 epiR_0.9-87
[16] RcmdrPlugin.EACSPIR_0.2-2 reshape_0.8.6 nortest_1.0-4
[19] ez_4.4-0 abind_1.4-5 R2HTML_2.3.2
[22] RcmdrPlugin.doex_0.2.0 RcmdrPlugin.DoE_0.12-3 relimp_1.0-5
[25] DoE.wrapper_0.8-10 rsm_2.8 FrF2_1.7-2
[28] DoE.base_0.30 conf.design_2.0.0 RcmdrPlugin.depthTools_1.3
[31] depthTools_0.4 RcmdrPlugin.coin_1.0-22 multcomp_1.4-6
[34] TH.data_1.0-8 mvtnorm_1.0-6 coin_1.2-0
[37] survival_2.41-3 biclust_1.2.0 colorspace_1.3-2
[40] MASS_7.3-47 RcmdrPlugin.BCA_0.9-8 flexclust_1.3-4
[43] modeltools_0.2-21 lattice_0.20-35 BCA_0.9-3
[46] Rcmdr_2.3-2 RcmdrMisc_1.0-5 sandwich_2.3-4
[49] car_2.1-5 ggthemes_3.4.0 ggplot2_2.2.1
[52] e1071_1.6-8 dplyr_0.7.1 rJava_0.9-8
[55] ModelMetrics_1.1.0 lme4_1.1-13 arules_1.5-2
[58] Matrix_1.2-10 ROCR_1.0-7 gplots_3.0.1
[61] RSQLite_2.0
loaded via a namespace (and not attached):
[1] stringr_1.2.0 gdata_2.18.0 gtools_3.5.0
[4] bindrcpp_0.2 rlang_0.1.1 htmlTable_1.9
[7] iterators_1.0.8 mgcv_1.8-17 blob_1.1.0
[10] bitops_1.0-6 base64enc_0.1-3 quantreg_5.33
[13] reshape2_1.4.2 R6_2.2.2 bit_1.1-12
[16] clue_0.3-53 plyr_1.8.4 tkrplot_0.0-23
[19] stringi_1.1.5 tcltk2_1.2-11 BsMD_2013.0718
[22] rpart.plot_2.1.2 munsell_0.4.3 vcd_1.4-3
[25] MatrixModels_0.4-1 ggthemr_1.1.0 htmlwidgets_0.9
[28] leaps_3.0 quadprog_1.5-5 quantmod_0.4-10
[31] pbkrtest_0.4-7 DBI_0.7 memoise_1.1.0
[34] bindr_0.1 foreign_0.8-69 pkgconfig_2.0.1
[37] BiasedUrn_1.07 tools_3.4.1 acepack_1.4.1
[40] SparseM_1.77 clv_0.3-2.1 cluster_2.0.6
[43] compiler_3.4.1 assertthat_0.2.0 caTools_1.17.1
[46] igraph_1.0.1 gtable_0.2.0 RcmdrPlugin.epack_1.2.5
[49] glue_1.1.1 readxl_1.0.0 digest_0.6.12
[52] RColorBrewer_1.1-2 knitr_1.16 doParallel_1.0.10
[55] htmltools_0.3.6 KernSmooth_2.23-15 DiceDesign_1.7
[58] data.table_1.10.4 lmtest_0.9-35 foreach_1.4.3
[61] sfsmisc_1.1-1 flashClust_1.01-2 RcmdrPlugin.FactoMineR_1.6-0
[64] fracdiff_1.4-2 backports_1.1.0 lazyeval_0.2.0
[67] magrittr_1.5 AlgDesign_1.1-7.3 checkmate_1.8.3
[70] estimability_1.2 minqa_1.2.4 timeDate_3012.100
[73] Rcpp_0.12.12 coda_0.19-1 bit64_0.9-7
[76] scales_0.4.1 TTR_0.23-2 lsmeans_2.26-3
[79] nloptr_1.0.4 combinat_0.0-8 tibble_1.3.3
[82] latticeExtra_0.6-28 RcmdrPlugin.Export_0.3-1 cellranger_1.1.0
[85] nnet_7.3-12 codetools_0.2-15 curl_2.7
[88] gridExtra_2.2.1 nlme_3.1-131 class_7.3-14
[91] parallel_3.4.1 lhs_0.14 rpart_4.1-11
[94] scatterplot3d_0.3-40
It may happen because you defined yearlier custom lm function by yourself and/or some package with specific lm definition had overriden base::lm.
You can call rm(list = ls()) as well restart your R session to
avoid this kind of behaviour.
Or you can call gt <- base::lm(Sales ~ Discount, data = dtsample2) to call lm from base package with desired functionality.
Please see the example how it happens:
lm <- function(x) {
0
}
lm(x ~ y, data = df)
# Error in lm(x ~ y, data = df) : unused argument (data = df)

R lapack routines cannot be loaded when using dtwclust

I am using shape method in dtwclust package. When I run the following code:
data(uciCT)
hc.sbd <- tsclust(CharTraj, type = "hierarchical",
k = 20L, distance = "sbd",
preproc = zscore, centroid = shape_extraction,
seed = 320L)
I have the following error information:
Error in eigen(M) : LAPACK routines cannot be loaded
In addition: Warning message:
In eigen(M) :
unable to load shared object '//PAPER/fchen4/R/R-3.3.2/modules/x64/lapack.dll':
`maximal number of DLLs reached...
After I use library(mgcv), I have got:
Error in eigen(M) : LAPACK routines cannot be loaded
How can I fix this error? I have tried the answers in R lapack routines cannot be loaded. But they do not work for me. I have also updated all the packages. But still cannot work.
The information from sessionInfo() is:
R version 3.3.2 (2016-10-31)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)
locale:
[1] LC_COLLATE=English_Australia.1252 LC_CTYPE=English_Australia.1252 LC_MONETARY=English_Australia.1252 LC_NUMERIC=C
[5] LC_TIME=English_Australia.1252
attached base packages:
[1] parallel splines stats graphics grDevices utils datasets methods base
other attached packages:
[1] mgcv_1.8-17 nlme_3.1-131 dtwclust_3.1.2 dtw_1.18-1 clue_0.3-53
[6] ROSE_0.0-3 scatterplot3d_0.3-39 plot3D_1.1 ggrepel_0.6.5 pdfCluster_1.0-2
[11] pastecs_1.3-18 boot_1.3-18 geosphere_1.5-5 sp_1.2-4 XLConnect_0.2-12
[16] XLConnectJars_0.2-12 ica_1.0-1 visNetwork_1.0.3 igraph_1.0.1 Barnard_1.8
[21] Kendall_2.2 pspearman_0.3-0 FSelector_0.21 dunn.test_1.3.4 randomUniformForest_1.1.5
[26] dbscan_1.1-1 Hmisc_4.0-2 Formula_1.2-1 xgboost_0.6-4 doParallel_1.0.10
[31] iterators_1.0.8 foreach_1.4.3 corrplot_0.77 gbm_2.1.3 survival_2.41-3
[36] AppliedPredictiveModeling_1.1-6 e1071_1.6-8 mlbench_2.1-1 caret_6.0-73 lattice_0.20-35
[41] fpc_2.1-10 devtools_1.12.0 lubridate_1.6.0 ggmap_2.6.1 gridExtra_2.2.1
[46] leaflet_1.1.0 qdap_2.2.5 RColorBrewer_1.1-2 qdapTools_1.3.1 qdapRegex_0.6.0
[51] qdapDictionaries_1.0.6 stringr_1.2.0 xtable_1.8-2 tidyr_0.6.1 scales_0.4.1
[56] plotly_4.5.6 ggplot2_2.2.1 psych_1.7.3.21 mxnet_0.9.4 randomForest_4.6-12
[61] cluster_2.0.6 pROC_1.9.1 openxlsx_4.0.17 proxy_0.4-17 dplyr_0.5.0
[66] plyr_1.8.4
loaded via a namespace (and not attached):
[1] backports_1.0.5 lazyeval_0.2.0 entropy_1.2.1 openNLP_0.2-6 crosstalk_1.0.0 digest_0.6.12 htmltools_0.3.5 gender_0.5.1
[9] gdata_2.17.0 magrittr_1.5 checkmate_1.8.2 memoise_1.0.0 xlsx_0.5.7 tm_0.7-1 wordcloud_2.5 jpeg_0.1-8
[17] colorspace_1.3-2 RWeka_0.4-33 RCurl_1.95-4.8 jsonlite_1.4 lme4_1.1-12 registry_0.3 gtable_0.2.0 MatrixModels_0.4-1
[25] car_2.1-4 kernlab_0.9-25 prabclus_2.2-6 DEoptimR_1.0-8 maps_3.1.1 SparseM_1.76 mvtnorm_1.0-6 rngtools_1.2.4
[33] DBI_0.6-1 Rcpp_0.12.10 CORElearn_1.50.3 plotrix_3.6-4 viridisLite_0.2.0 htmlTable_1.9 magic_1.5-6 foreign_0.8-67
[41] mapproj_1.2-4 mclust_5.2.3 stats4_3.3.2 htmlwidgets_0.8 httr_1.2.1 acepack_1.4.1 modeltools_0.2-21 XML_3.98-1.6
[49] rJava_0.9-8 flexmix_2.3-13 openNLPdata_1.5.3-2 nnet_7.3-12 venneuler_1.1-0 reshape2_1.4.2 munsell_0.4.3 tools_3.3.2
[57] geometry_0.3-6 knitr_1.15.1 ModelMetrics_1.1.0 robustbase_0.92-7 caTools_1.17.1 purrr_0.2.2 RgoogleMaps_1.4.1 mime_0.5
[65] quantreg_5.29 slam_0.1-40 compiler_3.3.2 flexclust_1.3-4 pbkrtest_0.4-7 png_0.1-7 tibble_1.3.0 stringi_1.1.5
[73] trimcluster_0.1-2 Matrix_1.2-8 nloptr_1.0.4 RWekajars_3.9.1-3 data.table_1.10.4 bitops_1.0-6 httpuv_1.3.3 R6_2.2.0
[81] latticeExtra_0.6-28 codetools_0.2-15 reports_0.1.4 MASS_7.3-45 gtools_3.5.0 assertthat_0.1 chron_2.3-50 proto_1.0.0
[89] xlsxjars_0.6.1 pkgmaker_0.22 rjson_0.2.15 withr_1.0.2 mnormt_1.5-5 diptest_0.75-7 grid_3.3.2 rpart_4.1-10
[97] class_7.3-14 minqa_1.2.4 misc3d_0.8-4 NLP_0.1-10 shiny_1.0.1 base64enc_0.1-3

Resources