[R] force fixed format

Göran Broström gb at stat.umu.se
Thu Jan 1 21:37:15 CET 2004


On Thu, Jan 01, 2004 at 09:04:41PM +0100, Fredrik Lundgren wrote:
> Hello,
> A small problem I can't solve
> 
>  > p <- 0.0001
> > p
> [1] 1e-04
> 
> How can I force the printout of p to 0.0001?
> I have tried 'format', 'round', 'signif', 'print' in different combinations without success.

You may check 'formatC':

> formatC(p)
[1] "0.0001"
-- 
 Göran Broström                    tel: +46 90 786 5223
 Department of Statistics          fax: +46 90 786 6614
 Umeå University                   http://www.stat.umu.se/egna/gb/
 SE-90187 Umeå, Sweden             e-mail: gb at stat.umu.se




More information about the R-help mailing list