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

______________________________________________
R-help@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.

Reply via email to