Skip to content

R number format with Hmisc and knitr

2 messages · Simon Zehnder

#
Dear R-Users and R-Devels,

I have a problem when using knitr in combination with Hmisc. I generate a data.frame which has mixed scientific and non-scientific numbers inside. In my Latex Table I just want to have non-scientific format, so I call

latex(myDataFrame,
file = '',
cdec = c(0, rep(4, NROW(myDataFrame) - 1)),
)

Usually this works, but in this case it doesn't. I do not know why but suspect the mixed data format to be the culprit. What could I do?

Using format(, scientific = FALSE) before or options(scipen = 4) before has no influence. 


Best

Simon
#
Errata:

it must say:

latex(myDataFrame,
file = '',
cdec = c(0, rep(4, NCOL(myDataFrame) - 1))
)

But this does not work. Scientific notation is very robust :)

Apologize

Simon
On Jul 31, 2013, at 5:05 PM, Simon Zehnder <szehnder at uni-bonn.de> wrote: