Skip to content
Prev 8971 / 15075 Next

Unexpected behavior from sprintf()

On Apr 24, 2012, at 6:07 PM, Duncan Murdoch wrote:

            
The ?sprintf help page indicated that non-character R objects will get  
passed though `as.character` on their way to the system facility. In  
the case of a factor variable which has levels with numeric-coercible  
values, we Mac users get very sensible output. Likewise we get very  
sensible output from character vectors, and when a format of "05i" is  
used the fact that we get the numeric encoding for factors is likewise  
no surprise.