2

How to render html output to pdf in knitr? Here is my code

\documentclass{article}
\begin{document}
<<echo=TRUE, results= 'asis'>>=
library(xtable)
n <- data.frame(x = 1:6, y = 15:20)
z=print(xtable(n),type='html', print.results=FALSE)
print(z)
@
\end{document}

The output is just raw html code not the table.

1 Answer 1

1

If i got you right you try to achieve something like

enter image description here

The full code is:

\documentclass{article} 
\begin{document} 
<<echo=TRUE, results= 'asis'>>= 
   library(xtable) 
   n <- data.frame(x = 1:6, y = 15:20) 
   print(
      xtable(n)
   )
@
\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .