[R] number of decimal

Peter Ehlers ehlers at ucalgary.ca
Thu Jan 28 15:12:18 CET 2010


?formatC
?sprintf

Ivan Calandra wrote:
> Hi everybody,
> 
> I'm trying to set the number of decimals (i.e. the number of digits 
> after the "."). I looked into options but I can only set the total 
> number of digits, with options(digits=6). But since I have different 
> variables with different order of magnitude, I would like that they're 
> all displayed with the same number of decimals.
> I searched for it and found the format() function, with nsmall=6, but it 
> is for a given vector. I would like to set it for the whole session, as 
> with options.
> 
> Can anyone help me?
> Thanks in advance
> Ivan
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide 
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
> 
> 

-- 
Peter Ehlers
University of Calgary



More information about the R-help mailing list