From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: graphing from org-tables Date: Mon, 26 Jan 2009 09:53:37 +0100 Message-ID: References: <74FDB779-BB93-414F-ABD3-DBA6DE6C528E@gmail.com> <87r640p2ld.fsf@gmail.com> <20090122162711.GA11250@stats.ox.ac.uk> <87y6x2ssz4.fsf@gmail.com> <0696199E-F0FC-4597-9705-B1660D208325@uva.nl> Mime-Version: 1.0 (Apple Message framework v930.3) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LRWgc-0008A4-Kf for emacs-orgmode@gnu.org; Mon, 26 Jan 2009 13:59:55 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LRWgZ-000856-DB for emacs-orgmode@gnu.org; Mon, 26 Jan 2009 13:59:52 -0500 Received: from [199.232.76.173] (port=36239 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LRWgY-00083i-LJ for emacs-orgmode@gnu.org; Mon, 26 Jan 2009 13:59:50 -0500 Received: from mx20.gnu.org ([199.232.41.8]:52687) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LRVJJ-0007W0-S2 for emacs-orgmode@gnu.org; Mon, 26 Jan 2009 12:31:47 -0500 Received: from ug-out-1314.google.com ([66.249.92.169]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LRNF7-00043t-4D for emacs-orgmode@gnu.org; Mon, 26 Jan 2009 03:54:53 -0500 Received: by ug-out-1314.google.com with SMTP id 36so168417uga.17 for ; Mon, 26 Jan 2009 00:53:42 -0800 (PST) In-Reply-To: <0696199E-F0FC-4597-9705-B1660D208325@uva.nl> 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: Carsten Dominik Cc: emacs-orgmode@gnu.org On Jan 23, 2009, at 8:30 AM, Carsten Dominik wrote: > > On Jan 23, 2009, at 2:37 AM, Eric Schulte wrote: > >> Dan Davison writes: >> >>> On Mon, Dec 22, 2008 at 12:00:14PM -0500, Eric Schulte wrote: >>>> Hi Dan, >>>> >>> >>> <...> >>> >>>> 2) Also interesting is the idea of referencing a table from a >>>> block of R >>>> code elsewhere in the org file. I've worked some on processing >>>> blocks of R code in org files in a manner similar to Sweave. >>>> http://github.com/eschulte/org-contrib/tree/master/org-exp-blocks.el >>>> If we could implement a simple means of referencing tables (either >>>> whole tables, or cells/cols/rows of tables) from these R-code >>>> blocks >>>> then that seems like it may be fairly powerful. >>> >>> I agree with this. So in the case of my code, I think we would >>> like to >>> be able to do something like >>> >>> #+TBLR: data: columns:(1 2) action:tabulate >>> >>> This would make the output of the analysis/plot of the table pointed >>> to by appear at the location in the file of >>> the >>> #+TBLR line. Perhaps one design aim would be to have the same >>> mechanism work for referencing tables for processing by #TBLFM, >>> org-plot, org-table-R, org-exp-blocks, etc. >> >> That sounds like a very good idea. A uniform interface for >> referencing >> table ranges (either globally from outside of the table or locally >> from >> within the table) that could be used for any table formula be it in >> calc, R, elisp, etc... I find the idea of easily accessing and >> writing >> table data from external tools very intriguing > > For what it is worth, here is a function that will grab a field value > or a range from a remote table, be it in the current file or in a > different file. That is not yet a syntax to have such a reference > in a formula, but it is the most important component, and maybe it > will > already be useful for you. > > This function uses an entry ID to access the table - obviously > other schemes like table naming could be used. > > It is not going to be very fast, and multiple accesses > to the same remote table would each cause the same overhead, > but it sure is working. > > - Carsten > > (defun org-table-remote-range (id form > &optional replace keep-empty numbers lispp) > "Get a field value or a list of values in a range from table at ID. In 6.19, there is now built-in unction to access data from arbitrary tables. - Carsten