Re: [R] format numbers in a contingency table

From: Gabor Grothendieck <ggrothendieck_at_gmail.com>
Date: Sun, 16 Dec 2007 10:48:22 -0500

Try:

print(x, digits = 3)

On Dec 15, 2007 9:22 PM, tom soyer <tom.soyer_at_gmail.com> wrote:
> Hi,
>
> I am constructing a contingency table using xtabs. The function works great:
> mo
> yr Sep Oct Nov Dec
> 1950 -7.164486e-02 3.152674e-02 -1.283389e-02 1.570382e-01
> 1951 3.054293e-02 4.665234e-02 -2.445499e-04 8.720204e-02
> 1952 3.937034e-02 -4.790636e-02 5.022616e-02 1.180279e-01
>
> but I wonder if there is an argument I can pass to xtabs to format the
> numbers in the table. For example, -0.0716 instead of -7.164486e-02. Does
> anyone know?
>
> Thanks!
>
> --
> Tom
>
>
> --
> Tom
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> 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 Sun 16 Dec 2007 - 15:51:26 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 Sun 16 Dec 2007 - 16:30:19 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.