[R] How to show number in the %f format?

David Winsemius dwinsemius at comcast.net
Thu Sep 24 00:16:32 CEST 2009


On Sep 23, 2009, at 5:58 PM, Peng Yu wrote:

> Hi,
>
> I have the following matrix, which is printed %e format (in C's way).
> I am wondering how make it be printed in %f format (in C's way)?

??"printf"  # scroll down to base package listings, the C function

?sprintf    # the s/r function


>
> Regards,
> Peng
>
>> significant_analysis_results[,7:8]
>              pval(ki-wt)     pval(ko-wt)
> Nab2      1.913348979e-06 2.731944670e-09
> Rasal1    2.482254110e-05 1.054711084e-05
> Ccndbp1   6.307674516e-08 2.268947934e-04
> Svep1     0.000000000e+00 1.564526286e-12
> Ppara     8.218961690e-04 2.802202914e-13
> Pros1     8.787052919e-07 0.000000000e+00
> Papss2    0.000000000e+00 2.190819073e-07
> Hdac9     0.000000000e+00 8.881784197e-16
> Adcyap1r1 2.085731587e-11 1.998401444e-15
> Robo1     0.000000000e+00 0.000000000e+00
> Sema3a    4.903322193e-11 0.000000000e+00
> Rab9b     1.099629676e-05 1.116694168e-06
> Tgfb3     0.000000000e+00 0.000000000e+00
> Slc9a9    7.460784795e-03 1.552167950e-09
> Creb5     2.959174867e-07 8.973577437e-11
> Ccnd1     7.868573521e-04 1.460805570e-07
> Pafah1b3  1.576464070e-08 6.757446065e-06
> Tiam2     0.000000000e+00 0.000000000e+00
> Etv5      2.279731959e-12 0.000000000e+00
> Hcrtr2    1.258646520e-10 1.661509722e-05
>> str(significant_analysis_results[,7:8])
> num [1:20, 1:2] 1.91e-06 2.48e-05 6.31e-08 0.00 8.22e-04 ...
> - attr(*, "dimnames")=List of 2
>  ..$ : chr [1:20] "Nab2" "Rasal1" "Ccndbp1" "Svep1" ...
>  ..$ : chr [1:2] "pval(ki-wt)" "pval(ko-wt)"
>
> ______________________________________________
> 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.

David Winsemius, MD
Heritage Laboratories
West Hartford, CT




More information about the R-help mailing list