From mboxrd@z Thu Jan 1 00:00:00 1970 From: William Denton Subject: Simplifying multiple "var" parameters for a code block Date: Wed, 1 Aug 2018 12:24:46 -0400 (EDT) Message-ID: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:43099) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fktvf-00076Z-L6 for emacs-orgmode@gnu.org; Wed, 01 Aug 2018 12:24:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fktvb-0006lN-Mr for emacs-orgmode@gnu.org; Wed, 01 Aug 2018 12:24:51 -0400 Received: from shell.miskatonic.org ([65.39.236.119]:53794) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fktvb-0006l6-HZ for emacs-orgmode@gnu.org; Wed, 01 Aug 2018 12:24:47 -0400 Received: from localhost (localhost [127.0.0.1]) by shell.miskatonic.org (Postfix) with ESMTP id AED17FA0081 for ; Wed, 1 Aug 2018 12:24:46 -0400 (EDT) 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" To: emacs-orgmode@gnu.org Is there a way to pull data from multiple clocktables (with names matching a regular expression) all at the same time into variables passed into a code block? I use clocktables to keep track of how I spend my time at work, with things falling into one of three major categories (see [1]). I use a different clocktable for every month, and they have names like c_201805, c_201806 and c_201807. For example: #+BEGIN: clocktable :maxlevel 3 :scope tree :compact nil :header "#+NAME: c_201808\n" #+NAME: c_201808 [ ... clocktable stuff here ... ] #+END This all works very well but it leads to some messiness when I want to gather up data from all of those clocktables at the same time. I use R to munge the data, and I have a source block that starts: #+BEGIN_SRC R :session R:clocktable :results none :var c_201709=c_201709 c_201710=c_201710 c_201711=c_201711 c_201712=c_201712 c_201801=c_201801 c_201802=c_201802 c_201803=c_201803 c_201804=c_201804 c_201805=c_201805 c_201806=c_201806 c_201807=c_201807 c_201808=c_201808 :colnames yes When I just had three or four monthly clocktables to handle, that was OK, but as you can see it's getting kind of crazy. Is there a way that I can get all of the c_YYYYMM tables passed into a code block, as done above, but without having to specify them individually? I have a feeling there's a bit of Lisp that would do it somehow, but I don't know what it would be. I'm happy to use an intermediary table if that's easiest. Any suggestions would be most welcome. Bill [1] https://www.miskatonic.org/2017/11/16/clocktableii/ -- William Denton :: Toronto, Canada --- Listening to Art: https://listeningtoart.org/ https://www.miskatonic.org/ --- GHG.EARTH: http://ghg.earth/ Caveat lector. --- STAPLR: http://staplr.org/