[R] How to increase decimal places

Philipp Pagel philipp.pagel.lists at t-online.de
Sun Nov 12 19:58:23 CET 2006


On Sun, Nov 12, 2006 at 07:32:49PM +0100, "Maja Schröter" wrote:
> does anybody know how to increase the decimal places that R uses to
> calculate something.
> 
> I think that in default R uses 6 decimal places but I need 12.

What you are experiencing is R PRINTING only a certain number of digits.
All calcualtions are done at full precision, though. 

Example:

> a=1/3
> a
[1] 0.3333333
> print(a)
[1] 0.3333333
> print(a, digits=12)
[1] 0.333333333333

For more details have a look at ?print and also at ?options and search
for 'digits'.

cu
	Philipp

-- 
Dr. Philipp Pagel                            Tel.  +49-8161-71 2131
Dept. of Genome Oriented Bioinformatics      Fax.  +49-8161-71 2186
Technical University of Munich
Science Center Weihenstephan
85350 Freising, Germany

 and

Institute for Bioinformatics / MIPS          Tel.  +49-89-3187 3675
GSF - National Research Center               Fax.  +49-89-3187 3585
      for Environment and Health
Ingolstädter Landstrasse 1
85764 Neuherberg, Germany
http://mips.gsf.de/staff/pagel



More information about the R-help mailing list