Re: [R] Try to debbug R script

From: Duncan Murdoch <murdoch_at_stats.uwo.ca>
Date: Fri 26 May 2006 - 23:08:53 EST

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



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Fri May 26 23:12:43 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Sat 27 May 2006 - 00:10:19 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.