[R] Printing integers in R "as is"

Firas Swidan firas at cs.technion.ac.il
Thu Apr 14 13:32:33 CEST 2005


Hi,
I am using the following command to print to a file (I omitted the file
details):

cat( paste( paste(orientation, start, end, names,"\n"), paste(start, end,
"exon\n"), sep=""))

where "orientation" and "names" are character vectors and "start" and
"end" are integer vectors.

The problem is that R coerce the integer vectors to characters. In
general, that works fine, but when one of the integer is 100000 (or has
more 0's) then R prints it as 1e+05. This behavior causes a lot of
trouble for the program reading R's output.
This problem occur with paste, cat,
and print (i.e. paste(100000)="1e+05" and so on).

I tried to change the "digit" option in "options()" but that did not help.
Is is possible to change the behavior of the coercing or are there any
work arounds?

Thanks in advance,
Firas.




More information about the R-help mailing list