[R] Simulation Result display form

jim holtman jholtman at gmail.com
Fri Nov 21 18:02:22 CET 2008


Use something like sprintf if you want trailing zeros.

> x
[1] 0.78
> sprintf("%.4f", x)
[1] "0.7800"
>



On Fri, Nov 21, 2008 at 5:31 AM, Abelian <abelian1982 at gmail.com> wrote:
> after obtaining the result, the result is displayed below:
>
>     individual  RS_number Phy_Posi LOH_intensity
> 1  1718890  rs1496555 2.224111        0.8121
> 2  1668776  rs2376495 3.084986        0.786  <---
> 3  1723597  rs4648462 3.155127        0.784  <---
> 4  1728870 rs10492940 3.187607        0.7831
> 5  1669946 rs10492939 3.292731        0.7801
> 6  1708099 rs10492938 3.294196        0.78   <---
> 7  1716798 rs10492937 3.329199        0.7791
> 8  1701872  rs1128474 3.535472        0.7733
> 9  1697748  rs2154068 3.710825        0.7685
> 10-1699138  rs2887274 3.711178        0.7685
>
> my problem is  in the result of LOH_intesity.
> i hope that 0.786 can be showed 0.7860, 0.78 can be 0.7800.
> so, how can I manage my result to be those?
> Thanks a lot...
>
> ______________________________________________
> 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.
>



-- 
Jim Holtman
Cincinnati, OH
+1 513 646 9390

What is the problem that you are trying to solve?



More information about the R-help mailing list