[R] cvm.test in CvM2SL2Test package and loops....

Rui Barradas ruipbarradas at sapo.pt
Sat Mar 1 20:47:49 CET 2014


Hello,

First of all, x and y don't seem to be lists, they seem to be matrices.
Second, the instrucions a<<-x[,i] and b<<-y[,j] change the variables a 
and b that exist outside the function. Why?
Third, exactly what do you mean by "crash"? What is the error message?

Finally, your example, as is, is not reproducible. Your function has no 
name? How are you calling it?

Hope this helps,

Rui Barradas

Em 01-03-2014 16:26, Levent TERLEMEZ escreveu:
> Dear Users,
>
> I have a problem with cvm.test using with for loop. It makes R crash while calculating. In the function, x and y are lists, also for loops controls the columns that will be tested:
>
> function (x,y)
>      {
>          cval=matrix(ncol=dim(x)[2],nrow=dim(x)[2])
>          for(i in 1:(ncol(x)-1))
>          {
>              a<<-x[,i]
>              #print('a')
>              #print(a)
>              for(j in (i+1):ncol(x))
>              {
>                  b<<-y[,j]
>                  #print('b')
>                  #print(b)
>                  cval[i,j]<-cvmts.test(a,b)
>                  #print(ab)
>              }
>          }
>      return(cval)
> }
>
> Thanks for your kind helps in advanced,
> Levent TERLEMEZ.
>
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>




More information about the R-help mailing list