plyr split_indices function crashes for long vectors

亡梦爱人 提交于 2020-01-02 07:52:10

问题


I am trying to run acast function from the package reshape2 on a large data set, and getting the program crash. I was able to localize this problem:

library(plyr)
n <- 15784000
g <- 1:n
split_indices(g, n) # NOTE for copy/pasters:
                    # this may result in an abort and R exit

I am getting the following error message:

*** caught segfault *** address 0x7ffffc3c44f0, cause 'memory not mapped'

Traceback:
 1: .Call("split_indices", group, as.integer(n))
 2: split_indices(g, n)

If I reduce the value of n:

n <- 3946000

then the error message is different:

Error: segfault from C stack overflow

The R system I am using:

> sessionInfo()
R version 2.15.2 (2012-10-26)
Platform: x86_64-unknown-linux-gnu (64-bit)
Package: plyr_1.8

Is this a distribution/build problem? Can it be fixed by appropriate choice of build parameters and how?

来源:https://stackoverflow.com/questions/14548570/plyr-split-indices-function-crashes-for-long-vectors

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!