[Rd] R crashes (PR#7037)

cornulier at cebc.cnrs.fr cornulier at cebc.cnrs.fr
Wed Jun 30 22:06:29 CEST 2004


Full_Name: thomas cornulier
Version: 1.9.0 and 1.9.1
OS: Win XP
Submission from: (NULL) (194.254.155.62)


the following function produces R crashes under windows XP
platform i386-pc-mingw32
arch     i386           
os       mingw32        
system   i386, mingw32  
status                  
major    1              
minor    9.1            
year     2004           
month    06             
day      21             
language R

start code-----
ts.cor<- function(Variable, Xcoord, Ycoord, Year){
  ts<- tapply(Variable, list(Year, paste(Xcoord, Ycoord)), mean)
  for(j in 1:500) {
    samp<- sample(seq(ncol(ts)), replace= T)
    cor.ts.boot<- cor(ts[, samp], use= "p", method= "spearman")
    cor.ts.boot<- cor.ts.boot[lower.tri(cor.ts.boot)]
  }
}

V<- rpois(180, 0.05)
X<- rep.int(runif(20), 9)
Y<- rep.int(runif(20), 9)
Yr<- rep(1:9, each= 20)
b<- ts.cor(V, X, Y, Yr)

end code------

use= "c" or use= "a" in cor() cause systematic crash, whereas use= "p" produces
crashes or inconsistent error messages:
Error in cor.ts.boot[lower.tri(cor.ts.boot)] : 
        object is not subsettable
In addition: There were 50 or more warnings (use warnings() to see the first
50)

Error in as.vector(x, mode) : cannot coerce to vector
In addition: There were 22 warnings (use warnings() to see them)

Error: invalid type/length (4/399) in vector allocation
In addition: There were 50 or more warnings (use warnings() to see the first
50)

Error in cor.ts.boot[lower.tri(cor.ts.boot)] : 
        Unimplemented feature in type2str
In addition: There were 50 or more warnings (use warnings() to see the first
50)

Error in cor.ts.boot[lower.tri(cor.ts.boot)] : 
        Unimplemented feature in type2str
In addition: There were 22 warnings (use warnings() to see them)


Behaviour similar whatever the method specification in cor(),
but V has to contain many ties for the errors/crashes being produced.
(problems fixed by jittering V)
V<- jitter(rpois(180, 0.05), a=0.001)

Crash occured at line 6 of the function when using debug()

Hope I didn't miss something obvious,
Thomas



More information about the R-devel mailing list