Re: [R] Displaying trailing zeroes

From: Christos Hatzis <christos.hatzis_at_nuverabio.com>
Date: Thu, 24 Jan 2008 16:52:12 -0500

formatC(round(12.01), digits=1, format="f")

-Christos

> -----Original Message-----
> From: r-help-bounces_at_r-project.org
> [mailto:r-help-bounces_at_r-project.org] On Behalf Of Lucke, Joseph F
> Sent: Thursday, January 24, 2008 4:37 PM
> To: r-help_at_r-project.org
> Subject: [R] Displaying trailing zeroes
>
> round(12.01,1) will give the answer 12, not 12.0 or even 12.

> To make a table look nice, I need to display the trailing
> zero so that just as
> round(12.05,1) yields 12.1, round(12.01) yields 12.0. I
> cannot find an answer in print() or format() or options().
> Any suggestions would be appreciated.
> Joseph F. Lucke, PhD
> Biostatistician
> Center for Clinical Research and Evidence-based Medicine
> University of Texas Medical School at Houston
> Email: Joseph.F.Lucke_at_uth.tmc.edu
>
>
> ______________________________________________
> 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.
>
>



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. Received on Thu 24 Jan 2008 - 21:52:15 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 24 Jan 2008 - 22:30:09 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive