From hb at stat.berkeley.edu  Sun Jun 21 00:44:24 2009
From: hb at stat.berkeley.edu (Henrik Bengtsson)
Date: Sat, 20 Jun 2009 15:44:24 -0700
Subject: [Rd] Flag '#' in sprintf() format string "%#x"?
Message-ID: <59d7961d0906201544x184e2d4ehd2da3cf66603a3@mail.gmail.com>

Hi, this is a bit of FYI, but also a question.

Is flag '#' in sprintf() format string "%#x" fully supported across
platforms?  Can that be assumed?  I discovered thanks to the r-forge
service, that this was not the case for OSX with "R version 2.9.0
Under development (unstable) (2009-01-13 r47593)", where R CMD check
reports the following:

Error in sprintf("%#x", values) :
  use format %d, %i, %x or %X for integer objects

where values <- as.integer(1:5). Note it works well on other
platforms; I don't know about newer R version on OSX.   Should I
consider this a glitch in an old version of R (newer R version do a
much better validation here), or should I simply avoid '#'?

Thanks,

/Henrik



[Rd] Flag '#' in sprintf() format string "%#x"?
Henrik Bengtsson