emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] Simplifying multiple "var" parameters for a code block


From: William Denton
Subject: [O] Simplifying multiple "var" parameters for a code block
Date: Wed, 1 Aug 2018 12:24:46 -0400 (EDT)
User-agent: Alpine 2.02 (DEB 1266 2009-07-14)

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/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]