[Rd] R crashes for large formulas in lm() (PR#8180)

ligges@statistik.uni-dortmund.de ligges at statistik.uni-dortmund.de
Wed Oct 5 14:12:10 CEST 2005


Prof Brian Ripley wrote:

> On Wed, 5 Oct 2005 hallgeir.grinde at elkem.no wrote:
> 
> 
>>Full_Name: Hallgeir Grinde
>>Version: 2.1.1
>>OS: Windows XP
>>Submission from: (NULL) (144.127.1.1)
>>
>>
>>While using lm(y~(x*z*c*...*v)^2) R crashes/closes if the numbers of variables
>>are at least 8.
> 
> 
> OK, let's try to reproduce that:
> 
> 
>>x1 <- runif(1000)
>>x2 <- runif(1000)
>>x3 <- runif(1000)
>>x4 <- runif(1000)
>>x5 <- runif(1000)
>>x6 <- runif(1000)
>>x7 <- runif(1000)
>>x8 <- runif(1000)
>>y <- rnorm(1000)
>>fit <- lm(y~(x1*x2*x3*x4*x5*x6*x7*x8)^2)
> 
> 
> No crash, a quite reasonable fit.
> 
> Can we please have a reproducible example, as we do ask?
> 

Hmm, crashes for me as well with R-2.1.1 and R-2.2.0 beta (2005-09-27 
r35682M) on WinNT 4.0, SP6.


Let's make it reproducible:

set.seed(123)
x1 <- runif(1000)
x2 <- runif(1000)
x3 <- runif(1000)
x4 <- runif(1000)
x5 <- runif(1000)
x6 <- runif(1000)
x7 <- runif(1000)
x8 <- runif(1000)
y <- rnorm(1000)
fit <- lm(y~(x1*x2*x3*x4*x5*x6*x7*x8)^2)


Uwe Ligges



More information about the R-devel mailing list