[R] sprintf funny behavior

Matt Young youngsanger at gmail.com
Tue May 11 18:53:56 CEST 2010


> sprintf("%d",4)
[1] "4"
> for(i in 1:4) sprintf("%d",4)
> for(i in 1:4) print(4)
[1] 4
[1] 4
[1] 4
[1] 4
>

Why doesn't sprintf like the for loop here



More information about the R-help mailing list