I am attempting to output a latex table using r markdown, kable and kableExtra. I get an error in the table rendering code that is not part of the latex code produced by R.
The code:
outTab <- m.OutTab %>%
kable(format='latex', booktabs=T ,
#caption = "Population Trend",
digits=1,
row.names=FALSE,
align='lccccc',
col.names = names_spaced,
escape = FALSE)
where "m.OutTab" is an matrix that contains the table to be rendered,
The error:
Error producing PDF.
! Misplaced \noalign.
\addlinespace ->\noalign
{\ifnum 0=`}\fi \@ifnextchar [{\@addspace }{\@addsp...
l.116 \addlinespace
Error: pandoc document conversion failed with error 43
These codes ("\noalign ...") is not part of "outTab".
Any idea how to work around this error?
header-includes: - \usepackage{booktabs}
but hard to know if that' s your problem – Footed