Thanks Yihui. I understood the invisible(booktabs()) after a bit of thought, but not Liviu's comment. Using his approach, could I run booktabs ina earlier chunk?
________________________________ From: Yihui Xie <x...@yihui.name> To: Liviu Andronic <landronim...@gmail.com> Cc: John Kane <jrkrid...@yahoo.ca>; Lyx List <lyx-users@lists.lyx.org> Sent: Tuesday, June 4, 2013 2:36:57 AM Subject: Re: Problem using R's table package with knitr. But John needs the LaTeX table output in the next line of R code; include=FALSE will exclude everything in that chunk. Moving booktabs() to the previous chunk and using include=FALSE there will be fine. Regards, Yihui -- Yihui Xie <xieyi...@gmail.com> Phone: 515-294-2465 Web: http://yihui.name Department of Statistics, Iowa State University 2215 Snedecor Hall, Ames, IA On Mon, Jun 3, 2013 at 11:29 PM, Liviu Andronic <landronim...@gmail.com> wrote: > On Mon, Jun 3, 2013 at 10:45 PM, Yihui Xie <x...@yihui.name> wrote: >> You should not print booktabs() in a chunk with results='asis', >> because that will generate invalid LaTeX code in the output. You can >> use invisible(booktabs()) or foo <- booktabs() to avoid printing. >> >> Or request Duncan (the package author) to return invisible(save) in >> booktabs(). >> > I simply use chunk with include=FALSE in this case. > > Liviu