[R] xtable caption knitr
AURORA GONZALEZ VIDAL
aurora.gonzalez2 at um.es
Tue Feb 24 12:16:56 CET 2015
Dear all,
I have a problem with the caption option on the xtable function.
Using Rmarkdown, knitr generates correctly a pdf when I write something
like this:
```{r xtable, results="asis"}
library( xtable )
variableName <- c( "V03_1" )
age <- c( rep(1,10),rep(2,10),rep(3,10) )
gender <- c( rep("m",15), rep("f",15) )
df <- data.frame( age, gender )
t <- xtable( df, caption = "hello" )
print( t, caption.placement = 'top',comment = FALSE )
```
But if I change to
t <- xtable(df, caption = variableName)
wich is what I really want it retuns a pandoc error:
! Missing $ inserted.
<inserted text>
$
l.112 \caption{V03_1}
pandoc: Error producing PDF from TeX source
Error: pandoc document conversion failed with error 43
I don't know why because variableName is also a character variable!
Any idea? Thank you very much!
------
Aurora González Vidal
Sección Apoyo Estadístico.
Servicio de Apoyo a la Investigación (SAI).
Vicerrectorado de Investigación.
Universidad de Murcia
Edif. SACE . Campus de Espinardo.
30100 Murcia
@. aurora.gonzalez2 en um.es
T. 868 88 7315
F. 868 88 7302
www.um.es/sai
www.um.es/ae
[[alternative HTML version deleted]]
More information about the R-help
mailing list