On Fri, May 10, 2013 at 8:55 PM, John Kane <jrkrid...@yahoo.ca> wrote: > I have been playing with LyX and knitr. I have had no problem generating > figures generally using ggplot2 I cannot get LyX to generate a table with > knitr and xtable. > See attached. Two issues: - You need to use chunk option results="asis" (similar to results=tex for Sweave) - By default xtable() outputs the table in a floating environment; it makes little sense to put that in a table float. Use print.xtable(..., floating=F) to avoid this.
Liviu > The file table.knitr one is my last attempt to generate a table. Not a > success though there is something there. table.kniter2.lyx is a successful > example of my running the same code in R and then just cutting and pasting > the resulting LaTeX code (minus the \begin{table}[ht] & \end{table} of > course. > > Can anyone give me some pointers as to what I am doing wrong? I seem to > have spent about 2 hours trying to find some useful examples without much > success. > > Thanks. -- Do you know how to read? http://www.alienetworks.com/srtest.cfm http://goodies.xfce.org/projects/applications/xfce4-dict#speed-reader Do you know how to write? http://garbl.home.comcast.net/~garbl/stylemanual/e.htm#e-mail
table.knitr1.lyx
Description: Binary data