From mboxrd@z Thu Jan 1 00:00:00 1970 From: Myles English Subject: sbe with :file header arg? Date: Fri, 07 Oct 2011 18:49:34 +0100 Message-ID: <87r52oy9n5.fsf@bill.home> Reply-To: emacs-orgmode@gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([140.186.70.92]:49703) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RCEWk-0002r7-Nc for emacs-orgmode@gnu.org; Fri, 07 Oct 2011 13:48:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RCEWj-00081c-KH for emacs-orgmode@gnu.org; Fri, 07 Oct 2011 13:48:06 -0400 Received: from mail-wy0-f169.google.com ([74.125.82.169]:43129) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RCEWj-00081R-G0 for emacs-orgmode@gnu.org; Fri, 07 Oct 2011 13:48:05 -0400 Received: by wyh15 with SMTP id 15so956574wyh.0 for ; Fri, 07 Oct 2011 10:48:03 -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 Hello, I think I have one case of strange behaviour and one feature request, if it isn't already possible. I would like to make one plot per row of a table. This is useful because the contents of the row may be parameters in an R session, and a link to the resulting plot can be put in the last cell of each row. The following source block makes a plot: #+source: plotTest #+headers: :var A="A" :var B="B" :var C="C" #+begin_src R :file nofile.png :results graphics :session b plot( 1,1, ylab=A, xlab=B) text(0.8,0.8,C) #+end_src #+results: plotTest [[file:nofile.png]] and the source block may be called using this table: #+TBLNAME: testtbl | "5" | "X" | "Y" | nofile.png | | 7 | P | "Q" | nofile.png | #+TBLFM: $4='(sbe plotTest (A $1)(B $2)(C $3)) executing that shows up the strange behaviour because the R interpreter contains: > > png(filename="nofile.png") > A <- "5" > B <- "X" > C <- "Y" > plot( 1,1, ylab=A, xlab=B) > text(0.8,0.8,C) > dev.off() null device 1 > > png(filename="nofile.png") > A <- 7 > B <- "/home/myles/org/org/nofile.png" <------ STRANGE, NO? > C <- "Q" > plot( 1,1, ylab=A, xlab=B) > text(0.8,0.8,C) > dev.off() null device 1 Now the feature request; would it be possible to pass a :file header based on a value in the table, like this? #+TBLNAME:testtwo | a.png | "G" | "E" | "F" | [[img/a.png]] | #+TBLFM: $4='(sbe plotTest[:file img/$1] (A $2)(B $3)(C $4)) Thanks, Myles