Skip to content

sprintf behavior (PR#9250)

3 messages · michael.bauer at lo-res.org, Peter Dalgaard

#
Full_Name: Michael Bauer
Version: 2.3.1
OS: Mac OS X 10.4.7
Submission from: (NULL) (131.130.124.155)
Version 2.3.1 (2006-06-01) 
powerpc-apple-darwin8.6.0 

attached base packages:
[1] "methods"   "stats"     "graphics"  "grDevices" "utils"    
[6] "datasets"  "base"
sprintf("\p") doesn't show the backslash, this occurs with all strings that
start with certain letters. There is however no explanation to this behavior.
And there seems to be no way to get a guaranteed backslash in sprintf.
#
michael.bauer at lo-res.org writes:
This is *not* a bug (it is also not a FAQ, although I'm beginning to
think it should be). Please read up on R's string handling, with
particular emphasis on the concept of escape characters.
[1] "\\p\n"
\p
[1] 3

Also, do not report things as bugs before you are 100% certain that
they are bugs.
#
Peter Dalgaard <p.dalgaard at biostat.ku.dk> writes:
Just to be clear: I'm aware of FAQ 7.8, but it is about file names.

Issue is whether we need a generic "backslashes in text strings"
entry.