From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christophe Pouzat Subject: Re: org-babel export table from R to LaTeX Date: Tue, 14 Feb 2012 18:25:14 +0100 Message-ID: <874nutjpj9.fsf@xtof-netbook.home> References: <87vcn99zv0.fsf@xtof-netbook.home> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([140.186.70.92]:39913) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RxM85-0003dH-7y for emacs-orgmode@gnu.org; Tue, 14 Feb 2012 12:25:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RxM80-0000Bc-CB for emacs-orgmode@gnu.org; Tue, 14 Feb 2012 12:25:25 -0500 Received: from mail-bk0-f41.google.com ([209.85.214.41]:44953) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RxM80-0000BX-23 for emacs-orgmode@gnu.org; Tue, 14 Feb 2012 12:25:20 -0500 Received: by bkty12 with SMTP id y12so245236bkt.0 for ; Tue, 14 Feb 2012 09:25:19 -0800 (PST) In-Reply-To: (Riccardo Romoli's message of "Tue, 14 Feb 2012 18:10:49 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Riccardo Romoli Cc: emacs-orgmode@gnu.org Sorry, Checking foo.org (http://orgmode.org/w/?p=3Dworg.git;a=3Dblob_plain;f=3Dorg= -contrib/babel/examples/foo.org;hb=3DHEAD) I got the correct way to do it: #+begin_src R :results output latex :exports results library(xtable) xtable(foo, caption =3D "ANOVA Table", label =3D "tab:one", digits =3D c(0, 0, 2, 0, 2, 3, 3)) #+end_src Does it solve your problem? Christophe Riccardo Romoli writes: > If I set :export latex when I exports to LaTeX I have only the R code, no= t the > table. > > Best > > 2012/2/14 Christophe Pouzat > > Riccardo Romoli writes: > > > Hi, I work with org-babel and R. > > In the R session I create a table that I have to export to LaTeX. > > This is the code I use: > > > > #+headers: :results latex > > #+begin_src R :session *R* :exports results > > ..... > > =C2=A0 print(xtable(summary(mypca))) > > #+end_src > > > > I do not understand why the exported table is delimited by "|": > > > > |% latex table generated in R 2.14.1 by xtable 1.6-0 package | > > | % Tue Feb 14 16:21:48 2012 | > > | \begin{table}[ht] | > > =C2=A0 | \begin{center} | > > =C2=A0=C2=A0=C2=A0 | \begin{tabular}{rrrrrrrrrrrrrrrrr} | > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | \hline | > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | & PC1 & PC2 & PC3 & PC4 & PC5 & PC= 6 & PC7 & PC8 & PC9 & PC10 & > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 PC11 & PC12 & PC13 & PC14 & PC15 & P= C16 \\ | > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | \hline | > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | Standard deviation & 3.4693 & 2.81= 13 & 2.5561 & 2.2668 & > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 2.0015 & 1.9236 & 1.7287 & 1.6220 & = 1.4288 & 1.3456 & 1.2596 & > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 1.2195 & 1.1278 & 1.0778 & 0.8390 & = 0.0000 \\ | > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | Proportion of Variance & 0.2188 & = 0.1437 & 0.1188 & 0.0934 & > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 0.0728 & 0.0673 & 0.0543 & 0.0478 & = 0.0371 & 0.0329 & 0.0289 & > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 0.0270 & 0.0231 & 0.0211 & 0.0128 & = 0.0000 \\ | > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | Cumulative Proportion & 0.2188 & 0= .3625 & 0.4813 & 0.5747 & > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 0.6476 & 0.7149 & 0.7692 & 0.8170 & = 0.8541 & 0.8871 & 0.9159 & > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 0.9429 & 0.9661 & 0.9872 & 1.0000 & = 1.0000 \\ | > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | \hline | > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | \end{tabular} | > > =C2=A0=C2=A0=C2=A0 | \end{center} | > > =C2=A0 | \end{table} | > > | | > > > > Should I change some headers settings?? > > > > Best > > > > Hi Riccardo, > > Try ":exports latex" instead of ":exports results" > > Christophe > -- > > Most people are not natural-born statisticians. Left to our own > devices we are not very good at picking out patterns from a sea of > noisy data. To put it another way, we are all too good at picking out > non-existent patterns that happen to suit our purposes. > Bradley Efron & Robert Tibshirani (1993) An Introduction to the Boots= trap > > -- > > Christophe Pouzat > MAP5 - Math=C3=A9matiques Appliqu=C3=A9es =C3=A0 Paris 5 > CNRS UMR 8145 > 45, rue des Saints-P=C3=A8res > 75006 PARIS > France > > tel: +33142863828 > mobile: +33662941034 > web: http://www.biomedicale.univ-paris5.fr/physcerv/C_Pouzat.html > > --=20 Most people are not natural-born statisticians. Left to our own devices we are not very good at picking out patterns from a sea of noisy data. To put it another way, we are all too good at picking out non-existent patterns that happen to suit our purposes. Bradley Efron & Robert Tibshirani (1993) An Introduction to the Bootstrap -- Christophe Pouzat MAP5 - Math=C3=A9matiques Appliqu=C3=A9es =C3=A0 Paris 5 CNRS UMR 8145 45, rue des Saints-P=C3=A8res 75006 PARIS France tel: +33142863828 mobile: +33662941034 web: http://www.biomedicale.univ-paris5.fr/physcerv/C_Pouzat.html