From mboxrd@z Thu Jan 1 00:00:00 1970 From: Brian Shine Subject: org-mode R using xtable produces strange output Date: Mon, 19 Mar 2018 23:44:21 +0000 Message-ID: <27130615-8997-4101-9888-35829EE3D968@mac.com> Mime-Version: 1.0 (Mac OS X Mail 11.2 \(3445.5.20\)) Content-Type: multipart/mixed; boundary="Apple-Mail=_02AA6D3F-5633-4E62-969C-FCB95F947393" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37531) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ey4SB-0003eu-4w for emacs-orgmode@gnu.org; Mon, 19 Mar 2018 19:44:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ey4S6-0002ld-A8 for emacs-orgmode@gnu.org; Mon, 19 Mar 2018 19:44:35 -0400 Received: from pv38p41im-ztdg02071201.me.com ([17.133.179.24]:39700) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ey4S6-0002hj-01 for emacs-orgmode@gnu.org; Mon, 19 Mar 2018 19:44:30 -0400 Received: from process-dkim-sign-daemon.pv38p41im-ztdg02071201.me.com by pv38p41im-ztdg02071201.me.com (Oracle Communications Messaging Server 8.0.1.2.20170607 64bit (built Jun 7 2017)) id <0P5V008002Z6AV00@pv38p41im-ztdg02071201.me.com> for emacs-orgmode@gnu.org; Mon, 19 Mar 2018 23:44:26 +0000 (GMT) Received: from icloud.com ([127.0.0.1]) by pv38p41im-ztdg02071201.me.com (Oracle Communications Messaging Server 8.0.1.2.20170607 64bit (built Jun 7 2017)) with ESMTPSA id <0P5V00B3739YGB00@pv38p41im-ztdg02071201.me.com> for emacs-orgmode@gnu.org; Mon, 19 Mar 2018 23:44:25 +0000 (GMT) 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" To: "Liste-emacs-orgmode@gnu.org" Cc: Brian Shine --Apple-Mail=_02AA6D3F-5633-4E62-969C-FCB95F947393 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 I am using xtable to produce summary tables of linear models, specifying = the output as latex. If I just run the code in R, I get the correct = output. However, the latex output in the org document contains a lot of = =E2=80=9C|=E2=80=9Ds. I think this is because the header of the table = contains some code to make =E2=80=9Cp > |t|=E2=80=9D, where the vertical = lines are to indicate =E2=80=9Cabsolute value of t=E2=80=9D. My guess = is that when the output is written to the results section, org = interprets the =E2=80=9C|=E2=80=9D signs as an org-table and tries to be = helpful by adding more of them to make up the correct number of columns. = If I switch off the latex output, and write the xtable to a small .tex = file, using xtable.print and then include the file after the code block, = the table appears correctly. I=E2=80=99m using emacs 25.2. Here=E2=80=99s an example: Best wishes, Brian --Apple-Mail=_02AA6D3F-5633-4E62-969C-FCB95F947393 Content-Disposition: attachment; filename=xtableeg.org Content-Type: application/octet-stream; x-unix-mode=0644; name="xtableeg.org" Content-Transfer-Encoding: 7bit #+BEGIN_SRC R :session :exports results :results latex library(xtable) examp <- data.frame(x = 1:10, y = 10:1) print.xtable(xtable(summary(glm(y ~ x, data = examp)))) #+END_SRC #+RESULTS: #+BEGIN_EXPORT latex | % latex table generated in R 3.4.4 by xtable 1.8-2 package | | | | % Mon Mar 19 23:41:04 2018 | | | | \begin{table}[ht] | | | | \centering | | | | \begin{tabular}{rrrrr} | | | | \hline | | | | & Estimate & Std. Error & t value & Pr($>$$ | $t$ | $) \\ | | \hline | | | | (Intercept) & 11.0000 & 0.0000 & 10932581685367508.00 & 0.0000 \\ | | | | x & -1.0000 & 0.0000 & -6166807764706701.00 & 0.0000 \\ | | | | \hline | | | | \end{tabular} | | | | \end{table} | | | | | | | #+END_EXPORT --Apple-Mail=_02AA6D3F-5633-4E62-969C-FCB95F947393 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii --Apple-Mail=_02AA6D3F-5633-4E62-969C-FCB95F947393--