[Rd] cat, print and documentation disagree (PR#8988)

bailey at galton.uchicago.edu bailey at galton.uchicago.edu
Thu Jun 15 22:27:46 CEST 2006


Full_Name: Paul Bailey
Version: 2.3.1
OS: OS X (10.4.6)
Submission from: (NULL) (128.135.133.123)


according to cat's help file, "'cat' converts numeric/complex vectors in the
same way as 'print' (and not in the same way as 'as.character' which is used by
the S equivalent), so 'options' '"digits"' and '"scipen"' are relevant."

But, run this (what I got after # marks)
------
a <- c(0.1,.0111111111111111)
> print(a)
[1] 0.10000000 0.01111111
> cat(a)
0.1 0.01111111> 
------

I would expect the two to make the same conversion and send the same number of
digits (zeros or not) to standard out, OR for the documentation to point out
that there are differences in that the same output can lead to different things
being sent to standard out.

I observed this same problem in Win XP with R 2.3.0

Cheers,
Paul



More information about the R-devel mailing list