Oh, great. TIL #RStats sprintf("%02s", x) differs on macOS and Linux; Linux: > s...

@henrikbengtsson@mastodon.social

Oh, great. TIL #RStats sprintf("%02s", x) differs on macOS and Linux;

Linux:

> sprintf("x=%02s", c("1", "2", "a"))
[1] "x= 1" "x= 2" "x= a"

macOS:

> sprintf("x=%02s", c("1", "2", "a"))
[1] "x=01" "x=02" "x=0a"

Personally, I'd argue padding strings with zeros should be an error. Oh well...