emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Thomas S. Dye" <tsd@tsdye.com>
To: Vikas Rawal <vikaslists@agrarianresearch.org>
Cc: emacs-orgmode@gnu.org
Subject: Re: [babel] html export of R data frame
Date: Mon, 19 Jul 2010 16:39:44 -1000	[thread overview]
Message-ID: <999EA819-B702-43C1-B825-7CCB32DDE9F8@tsdye.com> (raw)
In-Reply-To: <20100720022748.GA4367@panahar>


[-- Attachment #1.1: Type: text/plain, Size: 914 bytes --]


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



[-- Attachment #1.2: Type: text/html, Size: 3686 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
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

  reply	other threads:[~2010-07-20  2:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-20  2:27 [babel] html export of R data frame Vikas Rawal
2010-07-20  2:39 ` Thomas S. Dye [this message]
     [not found]   ` <20100720031301.GA6691@panahar>
2010-07-20  8:08     ` Thomas S. Dye

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=999EA819-B702-43C1-B825-7CCB32DDE9F8@tsdye.com \
    --to=tsd@tsdye.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=vikaslists@agrarianresearch.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).