From mboxrd@z Thu Jan 1 00:00:00 1970 From: stardiviner Subject: Re: org-babel strange html print in R Date: Tue, 11 Feb 2020 13:16:26 +0800 Message-ID: <87blq5u2j9.fsf@gmail.com> References: <875zgjh8wn.fsf@gmail.com> Reply-To: numbchild@gmail.com Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:35535) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j1NuR-0003wi-Io for emacs-orgmode@gnu.org; Tue, 11 Feb 2020 00:16:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j1NuQ-0002ZK-6j for emacs-orgmode@gnu.org; Tue, 11 Feb 2020 00:16:31 -0500 Received: from [223.104.247.49] (port=11558 helo=dark.localdomain) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1j1NuP-0002U1-Nv for emacs-orgmode@gnu.org; Tue, 11 Feb 2020 00:16:30 -0500 In-reply-to: <875zgjh8wn.fsf@gmail.com> 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-mx.org@gnu.org Sender: "Emacs-orgmode" To: Jeremie Juste Cc: emacs-orgmode@gnu.org You should try ~:results value html~. Here is what I got correctly: #+begin_src R :results value html library(xtable) x <- rnorm(100) y <- x + rnorm(100) print(xtable(summary(lm(y ~ x))),type="html") #+end_src #+RESULTS[<2020-02-11 13:14:59> 91ff0df2529284897e3585e3ec2e640290ee8308]: #+begin_export html
Estimate Std. Error t value Pr(>|t|)
(Intercept) -0.0064 0.1069 -0.06 0.9520
x 1.1066 0.1022 10.83 0.0000
#+end_export Jeremie Juste writes: > Hello, > > I've found that some strange results when outputing html from R. > Do you have some insights on a potential solution? > > Best regards, > Jeremie > > Org mode version 9.3.4 (9.3.4-elpa @ /home/djj/.emacs.d/elpa/org-20200206/) > > #+PROPERTY: header-args:R :eval yes :exports results :colnames yes :results output :output-dir images/ :cache yes :session *R* > > #+begin_src R :results output html > library(xtable) > x <- rnorm(100) > y <- x + rnorm(100) > print(xtable(summary(lm(y ~ x))),type="html") > #+end_src > > > #+RESULTS: > #+begin_export html > > > > > < > < > < > Estimate < > Std. Error < > t value < > Pr(>|t|) > < > > < > >
(Intercept) -0.0130 0.1023 -0.13 0.8991
x 1.0011 0.0987 10.14 0.0000
> #+end_export > > > ** Expected results > #+begin_export html > > > > >
Estimate Std. Error t value Pr(>|t|)
(Intercept) -0.0130 0.1023 -0.13 0.8991
x 1.0011 0.0987 10.14 0.0000
> #+end_export -- [ stardiviner ] I try to make every word tell the meaning what I want to express. Blog: https://stardiviner.github.io/ IRC(freenode): stardiviner, Matrix: stardiviner GPG: F09F650D7D674819892591401B5DF1C95AE89AC3