From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joe Bogner Subject: Org-babel & R exporting multiple tables Date: Wed, 22 May 2013 17:26:17 -0400 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Return-path: Received: from eggs.gnu.org ([208.118.235.92]:39564) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UfGYC-0007HP-TO for emacs-orgmode@gnu.org; Wed, 22 May 2013 17:26:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UfGY6-0006mG-4Q for emacs-orgmode@gnu.org; Wed, 22 May 2013 17:26:24 -0400 Received: from mail-vb0-x22f.google.com ([2607:f8b0:400c:c02::22f]:42586) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UfGY6-0006m3-0M for emacs-orgmode@gnu.org; Wed, 22 May 2013 17:26:18 -0400 Received: by mail-vb0-f47.google.com with SMTP id x13so1615130vbb.6 for ; Wed, 22 May 2013 14:26:17 -0700 (PDT) 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: emacs-orgmode@gnu.org I have a list of data frames that I would like to output. The number of frames may vary Is there a way to export multiple tables formatted? These are the three options I came up with. None of them work very well: Option #3 works the best, but it will append each time it's run in the doc, so I can't have the contents in the doc without having it duplicated. Option #2 would be good if I could just instruct it to render the table as HTML There was a post about 2 years ago that I attempted implement by adding (require 'ob-org) to my .emacs for #2 but it didn't seem to work (http://article.gmane.org/gmane.emacs.orgmode/29286/match=results+org+babel+ascii). * Option 1 Will combine the frames #+begin_src R :session *R* :colnames yes frames <- list() frames[[1]] <- data.frame(col=c("a","b")) frames[[2]] <- data.frame(col2=c("a","b")) frames #+end_src #+RESULTS: | col | col2 | |-----+------| | a | a | | b | b | * Option 2 It won't format on export #+begin_src R :session *R* :results output org :exports both frames <- list() frames[[1]] <- data.frame(col=c("a","b")) frames[[2]] <- data.frame(col2=c("a","b")) for(i in 1:2) { print(ascii(frames[[i]]), type="org") cat("\n") } #+end_src #+RESULTS: #+BEGIN_SRC org | | col | |---+-----| | 1 | a | | 2 | b | | | col2 | |---+------| | 1 | a | | 2 | b | #+END_SRC * Option 3 It will format on export but won't replace if it's run in the document #+begin_src R :session *R* :results output raw :exports both frames <- list() frames[[1]] <- data.frame(col=c("a","b")) frames[[2]] <- data.frame(col2=c("a","b")) for(i in 1:2) { print(ascii(frames[[i]]), type="org") cat("\n") } #+end_src