Skip to content

exporting a table to latex

3 messages · Rainer M Krug, Dieter Menne

#
Hi

I am using the latex() command from the Hmisc package to export  table 
to latex. For formating of the values, I use the format() function. But 
I don't manage to get the format of the values right: I don't want 
scientific notation, but if I say scientific=FALSE, I get many digits 
after the decimal point which I can not control with digits=... and 
nsmall=... in the format command.

Is there another way of formating the values to three decimal digits?

Or another way of exporting them to LaTeX?

Thanks

Rainer
#
Rainer M Krug <RKrug <at> sun.ac.za> writes:
There were a few bugs in the current versions of format.df (called by latex),
and the "scientific" problem could have been among them.

Try to download latex.s from 

http://biostat.mc.vanderbilt.edu/svn/R/Hmisc/branches/release_3.2-1/R/latex.s

do 

library(Hmisc)
source("latex.s")

and check if the problem disappears. If it does, write a mail to [charles.dupont
at vanderbilt.edu] and ask him to make the version public as soon as possible.

Dieter
#
Dieter Menne wrote:
Thanks - I did it but it still doesn't work.

I should have mentioned that I am using the function format() from the 
base package to create a data.frame which I then give to latex() to 
export - without formating from latex(). I am not using the format 
functions of the Hmisc package as I read that there are problems with them.

Rainer