I'm using the R xtable
package to print out my dataframes as LaTeX tables. I have been using the digits
option to specify the number of significant digits for the values in my tables. However, with digits=3
, I get outputs like:
...
chat & chatd & 1.04 & -0.526 & 0.943 \\
dav1 & davis & 0.922 & 0.0551 & 0.374 \\
...
I'd like to be able to specify the number of decimal places in my tables, so that everything has 3 decimal places, even if the last few places are padded with zeros. So, for example, the first numeric column would have
1.040
0.922
so that everything has 3 decimal places, and therefore everything lines up nicely.
Is there a way to do this?