簡體   English   中英

如何解決R軟件包安裝中的內存問題

[英]How to solve memory problems on R package install

我在嘗試通過添加其他數據來升級數據包時遇到錯誤。 問題是我遇到內存錯誤。 我確信其他人已經制作了具有更大數據集的軟件包。 人們如何解決這個問題?

==> R CMD INSTALL --no-multiarch --with-keep.source cfsales

* installing to library ‘/usr/local/lib/R/site-library’
* installing *source* package ‘cfsales’ ...
** using staged installation
** R
** data
*** moving datasets to lazyload DB
Error in lazyLoadDBinsertVariable(vars[i], from, datafile, ascii, compress,  : 
  long vectors not supported yet: connections.c:5984
ERROR: lazydata failed for package ‘cfsales’
* removing ‘/usr/local/lib/R/site-library/cfsales’
Warning in q("no", status = status, runLast = FALSE) :
  system call failed: Cannot allocate memory

這是我的數據目錄中內容的列表以及以MB為單位的文件大小。

total 188M
-rw-rw-r-- 1 ahallam ahallam   1M Jun 17 20:18 holidays_events.rda
-rw-rw-r-- 1 ahallam ahallam   1M Jun 17 20:18 items.rda
-rw-rw-r-- 1 ahallam ahallam   1M Jun 17 20:18 oil.rda
-rw-rw-r-- 1 ahallam ahallam   1M Jun 20 08:51 store_day_sales.rda
-rw-rw-r-- 1 ahallam ahallam   1M Jun 17 20:18 stores.rda
-rw-rw-r-- 1 ahallam ahallam   2M Jun 19 17:23 test.rda
-rw-rw-r-- 1 ahallam ahallam 185M Jun 19 17:36 train.rda
-rw-rw-r-- 1 ahallam ahallam   1M Jun 17 20:18 transactions.rda

這是我的sessionInfo

> sessionInfo()
R version 3.6.0 (2019-04-26)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.2 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/openblas/libblas.so.3
LAPACK: /usr/lib/x86_64-linux-gnu/libopenblasp-r0.2.20.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8     LC_MONETARY=en_US.UTF-8   
 [6] LC_MESSAGES=en_US.UTF-8    LC_PAPER=en_US.UTF-8       LC_NAME=C                  LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

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

other attached packages:
[1] cfsales_0.0.0.9000

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.1       clisymbols_1.2.0 packrat_0.5.0    crayon_1.3.4     withr_2.1.2      rprojroot_1.3-2  assertthat_0.2.1 R6_2.4.0        
 [9] backports_1.1.4  git2r_0.25.2     magrittr_1.5     rlang_0.3.4      rstudioapi_0.10  fs_1.3.1         testthat_2.1.1   desc_1.2.0      
[17] tools_3.6.0      glue_1.3.1       pkgload_1.0.2    compiler_3.6.0   usethis_1.5.0

如評論中所述,消息

目前尚不支持長向量:connections.c:5984

是可疑的 看着那條線,我們看到

inlen = LENGTH(in);

其中LENGTH (與XLENGTH )不支持長向量 ,即具有2^31 - 1 XLENGTH以上元素的向量。 以某種形式,您的數據文件由比此更長的向量表示。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM