[R] Try to debbug R script

Duncan Murdoch murdoch at stats.uwo.ca
Fri May 26 15:08:53 CEST 2006


On 5/26/2006 8:45 AM, LAURENS, Guillaume wrote:
> Hi,
> 
> I have a bug and I don't find it. Can u help me please.
> 
> In attachement :
> - My script file : CPU_study.txt
> - My data sample file : a.txt
> 
> When I use it, the error message is :
>> source("H:/R/_workspace/CPU_study_1.R")
> Erreur dans "[<-"(`*tmp*`, i, k, value = numeric(0)) :       rien à remplacer
>  (= error in ... nothing to replace)
> 
> I try a lot of thing but it doesn't work.
> The probleme is line 39 :
> val <- (val + t[(((i*step)-step)+j),k])

The error says that your indexing returned a zero length vector.  I'd 
suggest printing out the values of "(((i*step)-step)+j)" and "k" just 
before this line (or using the debugger to examine them).  They probably 
aren't in the range you were expecting.

Duncan Murdoch



More information about the R-help mailing list