[R] customizing the number of decimal places in xtable

Ogbos Okike giftedlife2014 @ending from gm@il@com
Tue Sep 18 04:24:37 CEST 2018


Dear Volunteers,

I have a table involving many decimal places:
2005-01-04 -2.13339817688037
2005-01-19 -6.86312349695117
2005-01-22 -4.33662370554386
2005-02-10 -1.40789214441639
2005-02-13 -1.1334121785854
2005-02-19 -1.28411233010119
2005-05-09 -1.6895978161324
2005-05-16 -3.07664523496947
2005-06-17 -1.69904491217129
2005-07-17 -3.44289318667434
2005-08-07 -2.29676435700659
2005-08-10 -1.08915071542227
2005-08-24 -1.8244123081697
2005-09-13 -4.57899147546373
2005-09-15 -3.96591895962343
 I used xtable to covert this to form of latex table.

The result I have is:
1 & 2005-01-04 & -2.13 \\
  2 & 2005-01-19 & -6.86 \\
  3 & 2005-01-22 & -4.34 \\
  4 & 2005-02-10 & -1.41 \\
  5 & 2005-02-13 & -1.13 \\
  6 & 2005-02-19 & -1.28 \\
  7 & 2005-05-09 & -1.69 \\
  8 & 2005-05-16 & -3.08 \\
  9 & 2005-06-17 & -1.70 \\
  10 & 2005-07-17 & -3.44 \\
  11 & 2005-08-07 & -2.30 \\
  12 & 2005-08-10 & -1.09 \\
  13 & 2005-08-24 & -1.82 \\
  14 & 2005-09-13 & -4.58 \\
  15 & 2005-09-15 & -3.97 \\.

It has truncated the long decimal places. Since it is not want I want, I
have to copy from the original table and place into xtable.

Can you please tell me how to customize the xtable so that I will be
responsible for the number of decimal places it displays.

Many thanks for your precious time.

Warmest regards
Ogbos

	[[alternative HTML version deleted]]



More information about the R-help mailing list