[R] sprintf does not print

Alaios alaios at yahoo.com
Wed Feb 16 11:15:06 CET 2011


Dear all I have an sprintf inside a loop to track changes in variable's value.

This sprintf statement works if I copy and paste it inside R
sprintf('I did the the %d,%d \n',k,l)

but when this is inside a loop I get no message.

listcounter<-1
for (k in c(1:mmax)){ # 
  for (l in c(1:nmax)){
   
    lst[[listcounter]] <-fun(estimatedsr)
    listcounter<-listcounter+1
    sprintf('I did the the %d,%d \n',k,l)
  }
}


When I paste the code above I never get any message printed. I know that the loop works. When I kill the execution of the loop the listcounter variable has value different from the initial one.

What might be the solution to that strange problem?

Best Regards
Alex



More information about the R-help mailing list