[R] R crashes with large vectors

Ben Bolker bbolker at gmail.com
Fri Jul 9 20:17:10 CEST 2010


Jeremie Smaga <jeremie <at> 4ecap.com> writes:

> 
> Good afternoon,
> 
> I have been experiencing a lot of crashes working with large vectors in R.
> 
> Specifically, I am using XTS of length of minimum 120k elements.
> 
> My problem is that I cannot display the vector (otherwise R crashes), I
> cannot plot it either (otherwise R crashes). That could be solved by
> reducing the amount of points.
> 
> However, I have been performing some statistical opreations on is and even
> sd(myXTS) crashes R.
> 
> By "crashes", I mean shuts down without any warning whatsoever.
> 
> I use R 2.11.1 (64).
> 
> Has anyone had the same kind of problem?
> 
> Can we solve this?


  You need to provide a reproducible example, or as nearly reproducible
as possible.  You need to provide more information about your system
(Windows?) -- the results of sessionInfo() would help.

  For example, I have no problem taking the standard deviation
of a million-element vector:

> set.seed(1001)
> sd(runif(1e6))
[1] 0.2884210
> sessionInfo()
R version 2.11.1 (2010-05-31) 
i486-pc-linux-gnu 

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=C              LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] 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     

  what happens on your system?



  

  sd(



More information about the R-help mailing list