From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Thomas S. Dye" Subject: Re: [babel] html export of R data frame Date: Mon, 19 Jul 2010 16:39:44 -1000 Message-ID: <999EA819-B702-43C1-B825-7CCB32DDE9F8@tsdye.com> References: <20100720022748.GA4367@panahar> Mime-Version: 1.0 (Apple Message framework v936) Content-Type: multipart/mixed; boundary="===============1624500761==" Return-path: Received: from [140.186.70.92] (port=33923 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ob2kM-0006zl-4K for emacs-orgmode@gnu.org; Mon, 19 Jul 2010 22:39:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Ob2kK-0002ve-Ps for emacs-orgmode@gnu.org; Mon, 19 Jul 2010 22:39:53 -0400 Received: from oproxy3-pub.bluehost.com ([69.89.21.8]:41616) by eggs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1Ob2kK-0002v8-Er for emacs-orgmode@gnu.org; Mon, 19 Jul 2010 22:39:52 -0400 In-Reply-To: <20100720022748.GA4367@panahar> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Vikas Rawal Cc: emacs-orgmode@gnu.org --===============1624500761== Content-Type: multipart/alternative; boundary=Apple-Mail-19-638673458 --Apple-Mail-19-638673458 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit On Jul 19, 2010, at 4:27 PM, Vikas Rawal wrote: > I have an R script which outputs a small table in the form of a > dataframe. In org-babel, this dataframe is not displayed as an org > table but simply as text laid out as it would be in an R session. > > When I export the output to html, I do not get an html table but only > text. How do I make org-babel show a table instead of plain text? > > For example, take a simple code block like: > > #+BEGIN_SRC R :results output :exports both :session y > x<-c(1:5) > y<-x^2 > data.frame(x,y) > #+END_SRC > > > Vikas > > Aloha Vikas, Is this what you want? #+BEGIN_SRC R :results value :exports both x<-c(1:5) y<-x^2 data.frame(x,y) #+END_SRC #+results: | 1 | 1 | | 2 | 4 | | 3 | 9 | | 4 | 16 | | 5 | 25 | hth, Tom Thomas S. Dye, Ph.D. T. S. Dye & Colleagues, Archaeologists, Inc. Phone: (808) 529-0866 Fax: (808) 529-0884 http://www.tsdye.com --Apple-Mail-19-638673458 Content-Type: text/html; charset=US-ASCII Content-Transfer-Encoding: quoted-printable
On Jul 19, 2010, = at 4:27 PM, Vikas Rawal wrote:

I = have an R script which outputs a small table in the form of = a
dataframe. In org-babel, this dataframe is not displayed as an = org
table but simply as text laid out as it would be in an R session. =

When I export the output to html, I do not get an html table but = only
text. How do I make org-babel show a table instead of plain = text?

For example, take a simple code block = like:

#+BEGIN_SRC R :results output :exports both :session y
=  x<-c(1:5)
 y<-x^2
=  data.frame(x,y)
#+END_SRC


Vikas



Aloha Vikas,

Is this = what you want?

#+BEGIN_SRC R :results = value :exports = both 
 x<-c(1:5)
 y<-x^2
 data.frame(x,y)
#+END_SRC

#+res= ults:
| 1 |  1 |
| 2 |  4 |
| 3 = |  9 |
| 4 | 16 |
| 5 | 25 = |

hth,
Tom


Thomas S. Dye, Ph.D.

T. S. Dye & Colleagues, = Archaeologists, Inc.

Phone: (808) 529-0866 Fax: (808) 529-0884

=

= --Apple-Mail-19-638673458-- --===============1624500761== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --===============1624500761==--